Ren
Ren

Reputation: 41

ModuleNotFoundError for Tensorflow and Anaconda (Windows 10)

I can't get tensorflow to work on two different Windows PCs and on both I get "ModuleNotFoundError: No module named 'tensorflow' when try to import them in python.

Numpy for example works on one machine not the other. Checked a dozen of posts on stackoverflow, nothing really helps. Clearly somethings wrong with the paths, can't really figure out what and how to trouble check it. I followed this set-up https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation-Windows.md I need the 1.7.1 version of TF for Unity ML-agents to work

                  OS: windows 10
      conda version : 4.4.11
conda-build version : 3.4.1
     python version : 3.6.4.final.0

Even a clean install of Anaconda didn't help.

Upvotes: 2

Views: 3073

Answers (2)

Ren
Ren

Reputation: 41

I finally managed to fix this (not with ML-agents, but that's a different story). I uninstalled Anaconda and Python as well as cleared the registry from all Python information. I had a previous installation of Python 3.7 and I'm guessing this might have caused some issues. Clean install of Anaconda with a 3.6 env and TF is working both with cpu and gpu support.

Upvotes: 2

Psychotechnopath
Psychotechnopath

Reputation: 2744

These problems often happen when you are on the wrong environment, or when you do not activate your environment. Please try the following steps and see if the problem persists:

  1. Open Anaconda prompt
  2. Activate the environment in which you installed tensorflow by using conda activate YOUR_ENV_NAME
  3. Type python to launch python
  4. try to import tensorflow

And see if the error persists.

Upvotes: 0

Related Questions