Zafir Stojanovski
Zafir Stojanovski

Reputation: 481

No module named '_pywrap_tensorflow'

Okay, so I've been trying to set up the CPU version of tensorflow on my 64 bit machine, but I've come across a common problem that even the docs point out.
It suggested that I install this, which I have:

Control Panel

but I still get the "No module named '_pywrap_tensorflow'" error when I run import tensorflow in python commmand line.

However I couldn't find the MSVCP140.DLL in the Path variable (not sure if I'm looking at the right place)

Path variable

How do I fix this? Why is it so complicated to install a single python library...
Anyway, in order to get the 2015 Redistributable working, I had to uninstall the 2017 version. (maybe that has to do something with it)

Upvotes: 3

Views: 4890

Answers (1)

Zafir Stojanovski
Zafir Stojanovski

Reputation: 481

Okay, after many hours of looking for an answer, I finally got it.
These are the steps you need to follow:

  1. Downgrade to Python 3.5 (3.6 and above are not supported for Tensorflow).
  2. Uninstall Microsoft Visual C++ 2017 Redistributable (both x86 and x64) if you already have it (usually comes with Win 10, but is not supported I suppose)
  3. Install Microsoft Visual C++ 2015 Redistributable
  4. Run python -m pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.1-cp35-cp35m-win_amd64.whl in command line.
    note: Upgrade pip to version 9 if this step gives you an error about some wheel.

voilà

Upvotes: 4

Related Questions