title: Python can't import existing TensorFlow module
body: <h1>Unable to import an existing module, using Ubuntu 16.04, python 3.5, Anaconda 4.2.15, tensorflow 0.12.</h1>
  
  <p>The TensorFlow package contains a helper <a href="https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/learn/python/learn/datasets" rel="nofollow noreferrer">module</a> called <code>mnist.py</code>. I've verified that the file exists on my machine, and manually added the directory to <code>sys.path</code>. When I try to import the module, python can't seem to find it. I can <code>import tensorflow as tf</code> just fine, but python seems to be looking for the module in the wrong directory although I've explicitly given it the correct location:</p>
  
  <pre><code>&gt;&gt;&gt; import tensorflow.contrib.learn.python.learn.datasets.mnist
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/__init__.py", line 25, in &lt;module&gt;
      from tensorflow.contrib import cudnn_rnn
    File "/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/cudnn_rnn/__init__.py", line 21, in &lt;module&gt;
      from tensorflow.contrib.cudnn_rnn.python.ops.cudnn_rnn_ops import CudnnGRU
    File "/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py", line 28, in &lt;module&gt;
      resource_loader.get_path_to_datafile("_cudnn_rnn_ops.so"))
    File "/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/util/loader.py", line 42, in load_op_library
      ret = load_library.load_op_library(path)
    File "/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
      None, None, error_msg, error_code)
  tensorflow.python.framework.errors_impl.NotFoundError: /home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/_cudnn_rnn_ops.so: cannot open shared object file: No such file or directory
  </code></pre>
  
  <hr>
  
  <p><strong>Verifying the file</strong>  </p>
  
  <pre><code> ls -l ~/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets
      total 44
      -rw-rw-r-- 2 rh rh 4660 Dec  1 12:09 base.py
      drwxrwxr-x 3 rh rh 4096 Jan 12 19:57 data
      -rw-rw-r-- 2 rh rh 2126 Dec  1 12:09 __init__.py
      -rw-rw-r-- 2 rh rh 1334 Dec  1 12:09 load_csv_test.py
      -rw-rw-r-- 2 rh rh 8308 Dec  1 12:09 mnist.py
      -rw-rw-r-- 2 rh rh 1317 Dec  1 12:09 produce_small_datasets.py
      drwxrwxr-x 2 rh rh 4096 Jan 12 19:57 __pycache__
      -rw-rw-r-- 2 rh rh 2745 Dec  1 12:09 text_datasets.py
  </code></pre>
  
  <hr>
  
  <p><strong>Verifying the path</strong>  </p>
  
  <pre><code> &gt;&gt;&gt; sys.path
      ['', '/home/rh/Applications/Anaconda/anaconda3/lib/python35.zip', 
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5', 
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/plat-linux',
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/lib-dynload',
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages',
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.6-py3.5.egg', 
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg', 
      '/home/rh/Applications/Anaconda/anaconda3/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/datasets']
  </code></pre>
  
  <hr>
  
  <p><strong>Tensorflow Info</strong>  </p>
  
  <pre><code>$ conda list | grep tensorflow  
  tensorflow                0.12.0rc0                py35_0    jjhelmus
  </code></pre>
  
  <hr>
  
  <p><strong>Only 1 Python Environment</strong>  </p>
  
  <pre><code>$ conda env list
  # conda environments:
  #
  root                  *  /home/rh/Applications/Anaconda/anaconda3
  
  $ type -p python
  /home/rh/Applications/Anaconda/anaconda3/bin/python
  </code></pre>
  
  <hr>
  
  <p>My source code comes from a tensorflow tutorial that runs perfectly on OSX, something about the Ubuntu install/environment is wonky. 
  I've been beating on this problem for a while without success. This related <a href="https://stackoverflow.com/questions/35236851/tensorflow-no-module-named-example-tutorials-mnist-input-data">question</a> doesn't address the issue either. Any suggestions?</p>