1

Installed python 3.5.2 and also tensorflow using pip command but getting error while importing tensorflow package. Used command as import tensorflow as tf to import tensorflow. But got error as;

Traceback (most recent call last):

File "", line 1, in

ImportError: No module named 'tensorflow'

How can I rectify this error? Can I get answer for this as soon as possible..

2
  • Can yo do a pip freeze and show the output here? Commented May 18, 2017 at 19:01
  • appdirs==1.4.3 numpy==1.12.1 packaging==16.8 protobuf==3.3.0 pyparsing==2.2.0 six==1.10.0 tensorflow==1.1.0 Werkzeug==0.12.2 You are using pip version 8.1.1, however version 9.0.1 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. Commented May 18, 2017 at 19:25

1 Answer 1

2

Are you running on a IDE or ipython or Jupyter? If yes, it's likely the IDE is using a different python such as virtualenv. It's possible there are multiple pythons installed in your system.

Open cmd and try the following

$ where python
$ python -c "import tensorflow"

Make sure the path you get is same as the installation path.

If there is still an error, compare with this path

$ where pip

It's possible your system is using a different python path if there are multiple python.

Sign up to request clarification or add additional context in comments.

1 Comment

I am using powershell . I deleted different paths where python is installed. Still getting the same issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.