Python ModuleNotFoundError: No module named tensorflow














































Python ModuleNotFoundError: No module named tensorflow



python ModuleNotFoundError: No module named 'tensorflow'


TensorFlow is a free and open-source software library which works on the dataflow graphs consists of nodes and edges. Where node represents mathematical operations and edges represents data is communicated between one node to another. It has flexible tools, libraries and resources where developers and researchers easily build ML applications.


If you were getting error while importing tensorflow, which means you haven't installed it.


And error will be like:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'


SOLUTIONS:

1.IF YOU'RE LINUX USER:

Run the following command on terminal:

#Before installing tensorflow create and activate virtual environment.

sudo pip3 install tensorflow   #for python3

Once the installation get completed, type 'import tensorflow' and it works.


2.IF YOU'RE WINDOWS USER:

Run the following command in command prompt:

pip install tensorflow

wait for sometime until it gets installed.


3.FOR ANACONDA:

Run the following command in Conda Prompt:

conda install tensorflow


Comments