On Windows, TensorFlow reports either or both of the following errors after executing an import tensorflow statement:
No module named \"_pyw
For tensorflow with CPU only:
I had installed tensorflow using command:
pip3 install --upgrade tensorflow
This installed tensorflow 1.7
But could not import the tensorflow from withing python 3.6.5 amd64 using:
import tensorflow as tf
So, i downgraded the tensorflow version from 1.7 to 1.5 using following command:
pip3 install tensorflow==1.5
This uninstalled the previous version and installed 1.5. Now it works.
Seems that, my CPU does not support AVX instruction set that is needed in tensorflow 1.7
I had MSVCP140.DLL in the system folders and .DLL in the PATHEXT variable in Environment Variable.