Jacob
Jacob

Reputation: 13

ImportError: No module named 'tensorflow' using anaconda + windows

Pip Installed tensor flow (CPU only... https://www.tensorflow.org/install/install_windows) in an anaconda environment, says it successfully installed but when I go to use tensor flow (with environment activated) it displays an error saying "ImportError: No module named 'tensorflow'".

However, After i installed pandas package, and it successfully runs. i ran an update to python=3.5 for the environment (because my anaconda is 2.7 version), and tried using this link https://github.com/tensorflow/tensorflow/issues/6136 for help also. Weird that other packages run but not tensor flow. Using a PC windows 10 with intel CPU and amd graphics. Any suggestions would be helpful.

Upvotes: 0

Views: 1680

Answers (2)

odd_wolf
odd_wolf

Reputation: 53

  1. First check which environment you are using right now.
  2. If it helps open the anaconda navigator and see whether you have TensorFlow installed in the "installed" tab of that particular environment.
  3. Check the following on jupyter noteook and see what python version you're using in that environment because the environment that you are using might have a different python version after all.
from platform import python_version

print(python_version())
  1. If the versions are different, try removing the TensorFlow installation and reinstalling it according to your python version. environment and recreating the same environment pip install --ignore-installed --upgrade tensorflow=='version_for_your_requirement"

  2. If the situation is still there, https://www.youtube.com/watch?v=tPq6NIboLSc see here the steps followed in the video. Though its a slightly different scenario, you will get the gist of it pretty quickly as to how we can make another environment for our work and about installing TensorFlow properly.

Upvotes: 1

user11530462
user11530462

Reputation:

Tensorflow supports 64-bit Python version. Make sure you have installed 64-bit Python 3.5/3.6/3.8 version. Install Tensorflow using following steps

#check current python version
python --version
#Create the virtual environment
conda create -n tf python=PYTHON_VERSION 
#Activate the tf environment
conda activate tf
#Install Tensorflow
pip install tensorflow 

Upvotes: 0

Related Questions