On Windows, TensorFlow reports either or both of the following errors after executing an import tensorflow
statement:
No module named "_pywrap_tensorflow"
DLL load failed.
On Windows, TensorFlow reports either or both of the following errors after executing an import tensorflow
statement:
No module named "_pywrap_tensorflow"
DLL load failed.
cuDNN causes my problem. PATH variable doesn't work for me. I have to copy the files in my cuDNN folders into respectful CUDA 8.0 folder structure.
I have Win7 Pro 64-bit on AMD cpu, no gpu. I was following the instructions under "Installing with native pip" at https://www.tensorflow.org/install/install_windows. The installation step went ok but the attempt to import tensorflow produced the infamous:
ImportError: No module named '_pywrap_tensorflow_internal'
This seems to be one of those situations where a lot of unrelated things can go wrong, depending on configuration, which all cascade through to the same error.
In my case, installing MSVCP140.DLL was the answer.
You have MSVCP140.DLL already if (a) you have a file C:\Windows\System43\MSVCP140.DLL, AND (b) if you have a 64 bit system, then you additionally have C:\Windows\SysWOW64\MSVCP140.DLL.
I installed it manually, which was unnecessary (the redistributable is not the whole Visual C++ development mess and isn't large). Use the link posted earlier in this thread to install it: Visual C++ 2015 redistributable.
Also, I recommend that you override the default install directory for Python and put it anywhere not under C:\Program Files, because Windows tries to write-protect files there, which causes problems later.
I posted a general approach for troubleshooting the "DLL load failed" problem in this post on Windows systems.
Use the DLL dependency analyzer Dependencies to analyze
<Your Python Dir>\Lib\site-packages\tensorflow\python\_pywrap_tensorflow_internal.pyd
and determine the exact missing DLL (indicated by a?
beside the DLL). The path of the .pyd file is based on the TensorFlow 1.9 GPU version that I installed. I am not sure if the name and path is the same in other TensorFlow versions.Look for information of the missing DLL and install the appropriate package to resolve the problem.
One may be tempted to keep the Powershell/cmd open on Windows. I've spent reasonable time till I decided to close and reopen my Powershell only to realize that I've done everything right.
TensorFlow
requiresMSVCP140.DLL
, which may not be installed on your system. To solve it open the terminal en type or paste this link:Note this is to install the CPU-only version of TensorFlow.
With TensorFlow release 1.3.0, you need to use Cudnn 6.0 instead of Cudnn 5.0 as Cudnn 5.0 is giving this error. Don't forget to add path variable to Cudnn 6.0 .With cudnn64_6.dll your Tensorflow will work fine. Read the link below. https://github.com/tensorflow/tensorflow/blob/master/RELEASE.md#release-130