ImportError: No module named tensorflow.python

ImportError: No module named tensorflow.python

Uninstall tensorflow:

pip uninstall tensorflow

Then reinstall it:

pip install tensorflow

for me upgrading pip helped,

pip install --upgrade pip
pip uninstall tensorflow
pip install tensorflow

ImportError: No module named tensorflow.python

I have the same problem in Windows 10. Until now I dont know why.

But if I create an virtual environment

cd <your project path>

Install virtualenv

pip install virtualenv

Create the virtual environment

virtualenv <envname>

Activate the env

  • Windows Powershell: .<envname>Scriptsactivate
  • Unix with Bash or zsh: source <envname>/bin/activate

Then now you install tensorflow

(<envname>) $ pip install tensorflow

And then run Hello World successfully.

*Dont forget that you need to activate or configure everytime the virtual environment jupyter, command-line, etc.

Leave a Reply

Your email address will not be published. Required fields are marked *