I'm trying to run a TensorFlow tutorial.

I need to execute the following command to fetch the learning data here.

from tensorflow.examples.tutorials.mnist import input_data</​​code></pre>
<p><br />
An error will occur as shown below.</p>
<pre><code data-language = "Python">&gt;&gt;&gt;from tensorflow.examples.tutorials.mnist import input_data
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in&lt;module&gt;
ImportError: No module named examples.tutorials.mnist

An error will occur if the contents of input_data are copied from the following and imported.

&gt;&gt;&gt;import input_data
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in&lt;module&gt;
  File "input_data.py", line 29, in&lt;module&gt;
    from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
ImportError: No module named contrib.learn.python.learn.datasets.mnist

In the first place, I think that I can't import anything from outside, but I don't know how to deal with it.
If anyone knows how to handle this [No module named xxxxxx], please teach me.
Python used
Python 2.7.10 (default, Jul 14 2015, 19:46:27)

  • Answer # 1

    from tensorflow.examples.tutorials.mnist The error isImportError: No module named examples.tutorials.mnistfortesorflow< It looks like you have an import named/code>.

    import tensorflow
    print (tensorflow .__ file __)
    It is a good idea to check the location of the file by appending

    , and check the actual procedure.

    Usually points to a location like.../lib/pythonX.Y/site-packages/tensorflow/__ init __. pyundersite-packagesmust. (X and Y are version numbers)

    If you put a file namedtensorflow.pyin the current directory andimport tensorflowpoints to that file, or you make a mistake like that, The

  • Answer # 2

    I tried the exact same procedure on another Mac and it worked without any problems.
    I'm sorry, I don't know the cause at all, but there seems to be a problem with the execution environment.
    Since it moved, I will close it for the time being.
    Thank you all.

  • Answer # 3

    Check here for a similar case