0

The error: on trying to import Tensorflow from my Python 3.6 installation directory.

My Python 3.6 is installed here: C:\Python36. All I did was python -m pip install tensorflow=1.5 To test the installation I ran import Tensorflow, but found this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python36\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "C:\Python36\lib\site-packages\tensorflow\python\__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "C:\Python36\lib\site-packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
  File "C:\Python36\lib\site-packages\google\protobuf\descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.

The options I tried:

  1. Downgrading to Python 1.5

  2. Getting the Windows redistributable that StackOverflow mentions here: On Windows, running "import tensorflow" generates No module named "_pywrap_tensorflow" error

    1. I tried another solution by reinstalling Python 3.6 with all the debugginf symbols and dlls but now I get the error :I tried another solution by reinstalling Python 3.6 with all the debugginf symbols and dlls but now I get the error : C:\Python36>python Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:57:36) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

    import tensorflow as tf hello = tf.constant('Hello, TensorFlow!') sess = tf.Session() 2018-09-17 17:51:52.231635: I C:\tf_jenkins\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 print(sess.run(hello)) b'Hello, TensorFlow!' does this mean tensorflow worked or not?

user2176576
  • 734
  • 3
  • 14
  • 39
  • Possible duplicate of https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso – Surya Tej Sep 17 '18 at 11:22
  • I tried another solution by reinstalling Python 3.6 with all the debugginf symbols and dlls but now I get the error : – user2176576 Sep 17 '18 at 12:23

2 Answers2

0

I had multiple python paths in the PATH variable in my system's environment variables.

I installed Python 3.6.2 and then put the path in the environment variables, removing the other paths.

Thanks

user2176576
  • 734
  • 3
  • 14
  • 39
0

i would suggest you just use anaconda if possible it works like a charm, and you don't have to manege anything, i too got that messege, and just desided to give up, and take the easy way. https://www.tensorflow.org/install/install_windows and here is the download page for anaconda https://www.anaconda.com/download/

Jonas Wolff
  • 2,034
  • 1
  • 12
  • 17