1

after watching few videos on Youtube I though Tensorflow is such a cool kit. Having just a tiny bit of experience with Python, naturally I tried to install it get my hands dirty. Usually when I try to install some add-on for Python I just simply do: python -m pip install

(by the way I'm running Win10 on a laptop with i5-8250U & GeForce MX150) but this method gives me no luck with Tensorflow. I then followed suggestion here, only changing

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl

to

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.11.0-py3-none-any.whl

and it magically installed. But now when I try

import tensorflow

I get these nasty errors:

Traceback (most recent call last):
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\__init__.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(__file__)])
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Mee\AppData\Local\Programs\Python\Python37-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper
    import _pywrap_tensorflow_internal
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

Would anyone who experienced similar error when importing tf for the first time give me a hand? Much appreciated.

Update: thanks to all who commented, problem solved! I just had to downgrade from Python 3.7 to 3.6. It's all works fine now.

Matt Chen
  • 19
  • 2
  • What cpu are you running? – Ben10 Oct 16 '18 at 05:30
  • Intel Core i5 Gen 8 – Matt Chen Oct 16 '18 at 05:30
  • Oh ok. I had the same error, but it turns out that the problem was that my outdated intel core duo, was lacking avx instructions. – Ben10 Oct 16 '18 at 05:31
  • I doubt that this is the cause in your case – Ben10 Oct 16 '18 at 05:32
  • Have you checked https://stackoverflow.com/a/43566341/8625593? – Ben10 Oct 16 '18 at 05:33
  • Interesting, so this could also be caused by hardware? That seems strange – Matt Chen Oct 16 '18 at 05:33
  • Apparently tensorflow is built requiring the AVX instruction set, which is something that is hardcoded into your cpu. However, for my case I had to install a version of tensorflow that did not use avx instructions – Ben10 Oct 16 '18 at 05:35
  • Yes, I've looked up the post you mentioned already. It looks quite involved; I assumed there must be a more elegant solution to this :( – Matt Chen Oct 16 '18 at 05:36
  • I see, does that mean you have to go back using an older version? – Matt Chen Oct 16 '18 at 05:37
  • If you want to try what worked for me I wrote an answer here: https://stackoverflow.com/a/50050336/8625593 – Ben10 Oct 16 '18 at 05:37
  • And no, there is another user maintain a tensorflow version which is does not required avx instructions – Ben10 Oct 16 '18 at 05:38
  • Please follow the installation instructions carefully. TF does not work with python 3.7 yet. – P-Gn Oct 16 '18 at 07:56
  • I had the problem with the AVX instructions with an old Core i7 CPU, although I can't tell what gen. I think the latest version without AVX is v15.0 or v1.5.1, if you want to try that (see [v1.6.0](https://github.com/tensorflow/tensorflow/releases/v1.6.0) release notes). – jdehesa Oct 16 '18 at 13:16
  • Wait that URL is for Mac, isn't it? That wouldn't work on Win10. – jdehesa Oct 16 '18 at 13:19
  • Look in [this page](https://www.tensorflow.org/install/pip) to find the correct package URL for your environment. – jdehesa Oct 16 '18 at 13:34
  • Thanks everyone, problem solved. I downgraded to Python 3.6 and everything works. – Matt Chen Oct 17 '18 at 01:08

0 Answers0