Hanan Shteingart
Hanan Shteingart

Reputation: 9078

On Windows, running “import tensorflow” generates No module named '_pywrap_tensorflow_internal' error

This is a different error than On Windows, running "import tensorflow" generates No module named "_pywrap_tensorflow" error as it points on _pywrap_tensorflow_internal. I also checked and MSVCP140.dll as suggested in the quoted question solution and it is on path (actually on multiple locations, is that a problem?)

Upvotes: 1

Views: 1583

Answers (5)

EKNATH KULKARNI
EKNATH KULKARNI

Reputation: 404

For cpu I found the solution and it worked

  • Run below command it will clear all dependencies and then update it or remove and install the latest version of tensor flow

            `pip install tensorflow==1.5`
    

Upvotes: 1

ste_kwr
ste_kwr

Reputation: 1010

As mentioned by @wowas, this is due to the DLLs not working.

The nightly build with CUDA 9.0 worked for me following the instructions here

Upvotes: 0

user1698581
user1698581

Reputation: 73

After struggling for 7 hours, I noticed that Tensorflow should be run under python 64 bit, while the default download file from python website is 32 bit. Furthermore, Tensorflow work's only under python 3X under windows.

Upvotes: 0

wowas
wowas

Reputation: 1

As specified in other answers the issue is related to python not being able to load some .dll files.

The generic solution to the problem in question would be to conduct the following steps:

  1. Download and run processmonitor.aspx from technet.microsoft.com
  2. Filter entries in Process Monitor by Process Name (user "Python.exe")
  3. Run python interpreter
  4. Type import tensorflow as tf and watch the results in Process Monitor
  5. Entries in Process Monitor with Path column containing *.dll name and Result column having NAME NOT FOUND show exactly what is missing.
  6. Assuming that you have correctly installed CUDA environment find out the dll from point 4 on you disk and include it in your path (I have specified a separate %CUDA_PATH% environment variable for that that is referenced from %PATH%)
  7. If dll is not found go back to Tensorflow and CUDA tutorials on their integration.

In my case neither of CUDA nor Tensorflow docs specified clear enough for me what files should be included in the PATH after CUDA installation.

Upvotes: 0

Srinivas Valekar
Srinivas Valekar

Reputation: 1123

I had the same issue for tensorflow with gpu supported library, I tried the answer written in this link Cannot import Tensorflow for GPU on Windows 10

And it worked like a charm for me! Hope this helps you.

Upvotes: 0

Related Questions