python – ImportError: No module named tensorflow

python – ImportError: No module named tensorflow

Try installing tensorflow again with the whatever version you want and with option –ignore-installed like:

pip install tensorflow==1.2.0 --ignore-installed

I solved same issue using this command.

I had a more basic problem when I received this error.

The Validate your installation instructions say to type: python

However, I have both 2.7 and 3.6 installed. Because I used pip3 to install tensorflow, I needed to type: python3

Using the correct version, I could import the tensorflow module.

python – ImportError: No module named tensorflow

Check if Tensorflow was installed successfully using:

 pip3 show tensorflow

If you get something like

Name: tensorflow
Version: 1.2.1
Summary: TensorFlow helps the tensors flow
Author: Google Inc.
Author-email: [email protected]
License: Apache 2.0
Location: /usr/local/lib/python3.5/dist-packages
Requires: bleach, markdown, html5lib, backports.weakref, werkzeug, numpy, protobuf, wheel, six

You may try adding the path of your tensorflow location by:

export PYTHONPATH=/your/tensorflow/path:$PYTHONPATH.

Leave a Reply

Your email address will not be published.