Importerror: No Module Named Tensorflow

Tensorflow import error: No module named 'tensorflow'

The reason Python 3.5 environment is unable to import Tensorflow is that Anaconda does not store the tensorflow package in the same environment.

One solution is to create a new separate environment in Anaconda dedicated to TensorFlow with its own Spyder

conda create -n newenvt anaconda python=3.5
activate newenvt

and then install tensorflow into newenvt

I found this primer helpful

No module named 'tensorflow.compat'

This just happened to me but I figured it out. Your .py script filename is the same with one of the files of the tensorflow library. You can just rename your python script and it will work fine.

ImportError: No module named tensorflow.keras.applications

try
from tensorflow.keras.applications import resnet

or try downgrading to tensorflow 2.7

!pip uninstall tensorflow

!pip install tensorflow==2.7

ModuleNotFoundError: No module named 'tensorflow'

The problem was solved by me(after a whole week). The solution was to downgrade python from 3.5.6 to 3.5.4. Not clear why such a minor difference caused such problems! :) Hope it helps someone else too....



Related Topics



Leave a reply



Submit