Reputation: 163
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..
Upvotes: 1
Views: 178
Reputation: 1971
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.
Upvotes: 2