You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then I goes into python,
then import tensorflow as tf,
I got this error:
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\__init__.py", line 4, in <module>
from tensorflow.python import *
File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\__init__.py", line 22, in <module>
from tensorflow.python.client.client_lib import *
File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\client\client_lib.py", line 35, in <module>
from tensorflow.python.client.session import InteractiveSession
File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\client\session.py", line 11, in <module>
from tensorflow.python import pywrap_tensorflow as tf_session
File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "C:\Users\Or\AppData\Local\Enthought\Canopy\User\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ImportError: No module named _pywrap_tensorflow
The problem is that you are trying to install the Mac version of TensorFlow on Windows, and Windows is not supported. Follow #17 for progress in that regard.
I'm using docker on my Mac and I get the same error. I'm trying to run tensorflow serving.
root@9b82edf4d8e7:/serving# bazel-bin/tensorflow_serving/example/inception_export --checkpoint_dir=inception-v3 --export_dir=inception-export
Traceback (most recent call last):
File "/serving/bazel-bin/tensorflow_serving/example/inception_export.runfiles/tensorflow_serving/example/inception_export.py", line 25, in <module>
import tensorflow as tf
File "/serving/bazel-bin/tensorflow_serving/example/inception_export.runfiles/external/org_tensorflow/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/serving/bazel-bin/tensorflow_serving/example/inception_export.runfiles/external/org_tensorflow/tensorflow/python/__init__.py", line 48, in <module>
from tensorflow.python import pywrap_tensorflow
File "/serving/bazel-bin/tensorflow_serving/example/inception_export.runfiles/external/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/serving/bazel-bin/tensorflow_serving/example/inception_export.runfiles/external/org_tensorflow/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper
import _pywrap_tensorflow
ImportError: No module named _pywrap_tensorflow
I just had this problem and solved it, will post my results here for future readers.
The problem (for me) was that my numpy was v1.08, whereas tensorflow wants v1.11. Upgrading numpy on El Capitan may not be easy; I had to (a) reboot in recovery mode, (b) open terminal and type "csrutil disable", (c) boot normally and upgrade numpy (pip2 install --user --upgrade numpy), (d) reboot in recovery mode again, and (e) open terminal and type "csrutil enable".
Traceback (most recent call last):
File "<pyshell#1>", line 1, in
import tensorflow as tf
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/init.py", line 23, in
from tensorflow.python import *
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 21, in
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module import(name)
ImportError: No module named _pywrap_tensorflow
@alihusn Sorry to resurrect an old thread, but how did installing this fix your problem? I've installed Visual C++ 2015 Redistributable and have made sure that MSVCP140.DLL is in my path, yet I'm still getting the error.
Activity
mrry commentedon Feb 8, 2016
Answered this question on StackOverflow: http://stackoverflow.com/questions/35277339/cannot-import-tensorflow-in-python/35277461#35277461
The problem is that you are trying to install the Mac version of TensorFlow on Windows, and Windows is not supported. Follow #17 for progress in that regard.
kentastudillo commentedon Jul 7, 2016
I'm using docker on my Mac and I get the same error. I'm trying to run tensorflow serving.
zaichang commentedon Nov 17, 2016
I have the same issue as killuabone as I am also using docker on OS X, running through the steps detailed here:
https://tensorflow.github.io/serving/serving_inception.html
cag472 commentedon Nov 27, 2016
I just had this problem and solved it, will post my results here for future readers.
The problem (for me) was that my numpy was v1.08, whereas tensorflow wants v1.11. Upgrading numpy on El Capitan may not be easy; I had to (a) reboot in recovery mode, (b) open terminal and type "csrutil disable", (c) boot normally and upgrade numpy (pip2 install --user --upgrade numpy), (d) reboot in recovery mode again, and (e) open terminal and type "csrutil enable".
alihusn commentedon Jan 8, 2017
For windows users install Visual C++ 2015 redistributable (x64 version) to be able to import tensorflow
Alkhoraif commentedon Jan 27, 2017
I got the same issue. Please, how can I solve it
Traceback (most recent call last):
File "<pyshell#1>", line 1, in
import tensorflow as tf
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/init.py", line 23, in
from tensorflow.python import *
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/init.py", line 49, in
from tensorflow.python import pywrap_tensorflow
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 21, in
_pywrap_tensorflow = swig_import_helper()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 20, in swig_import_helper
return importlib.import_module('_pywrap_tensorflow')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
ImportError: No module named _pywrap_tensorflow
arkwave commentedon Feb 6, 2017
@alihusn Sorry to resurrect an old thread, but how did installing this fix your problem? I've installed Visual C++ 2015 Redistributable and have made sure that
MSVCP140.DLLis in my path, yet I'm still getting the error.alihusn commentedon Feb 11, 2017
Well it worked for me :P
srikant86panda commentedon Feb 18, 2017
After installation of Visual C++ 2015 Redistributable it worked for me
jhli973 commentedon Mar 4, 2017
I have the same error (ImportError: No module named _pywrap_tensorflow), my solution:
Iinstall cuDNN v5.1 for CUDA 8.0
You need to register a NVIDIA accelerated computing developer program, then from here (https://developer.nvidia.com/rdp/cudnn-download) download and unzip it.
Copy all three subfolders and past it under CUDA folder, in my case is
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA
Then , you should be able to load tensorflow without any error
NOTE, I use python 3.5
mrgloom commentedon Mar 24, 2017
+1
hsinghal-wisc commentedon Mar 25, 2017
any solution for MAC users ?
bhavsarpratik commentedon Mar 25, 2017
Hi, I have laid down step-by-step instructions to successfully install Tensorflow on Windows.
https://github.com/bhavsarpratik/install_Tensorflow_GPU_windows
coolajitsahu commentedon Aug 7, 2018
hello i have also same problem ....
abdulqadir88 commentedon Apr 18, 2019
Also facing the issue tried to install the
Microsoft Visual C++ 2015 Redistributablebut when i checked the control panel it is already present thereAny Help plz ?