ModuleNotFoundError: No module named 'Tensorflow' in Python
I am running my python project on windows 10. I am having problems with importing
TensorFlow in my project. I installed tensorflow using pip3 but I got an error as below:
Traceback (most recent call last):
File "main.py", line 1, in <module>
ModuleNotFoundError: No module named 'Tensorflow'
I am using python 3.7.5 and TensorFlow 2.0.0.
I just installed TensorFlow with command:
pip3 install tensorflow==2.0.0
But it still solve issue for me!!
How can I fix it?
Leonardo Urbano Aug 11 2021
For your project, please try to create a new virtual environment and then install all your required packages.
python3 -m venv env
and to activate it using the command:
and then install the
tensorflowpackage inside your virtual environment:
pip3 install tensorflow
I hope it solve for you.
Gornpol Suksumrate Aug 11 2021
A better solution is to use a new Anaconda environment for your project. Once you’ve installed Anaconda, you can create a new environment and install TensorFlow:
conda create --name tensorflow-env python=3.8 pip conda activate tensorflow-env pip install tensorflow
Note: you can use a Python version other than 3.8, but as of this post the latest TensorFlow does not yet support 3.9.
If you need a version of TensorFlow before 2.0, you will need to install an earlier version of Python:
conda create --name tensorflow-env python=3.6 pip conda activate tensorflow-env pip install "tensorflow<2.0"
Hope it works for you.
Dhiraj Goplani Aug 11 2021
tensorflowagain with whatever version you want and with option
pip install tensorflow==2.0.0 --ignore-installed
I solved the same issue using this command.