1

I installed Python 3.8 and TensorFlow 1.12 on Windows 8, however, when writing this code (noting that I am not using Anaconda):

import tensorflow as tf

I' m getting the following error:

Traceback (most recent call last):
  File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-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\Dany\AppData\Local\Programs\Python\Python38-32\lib\imp.py", line 296, 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\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\Dany\AppData\Local\Programs\Python\Python38-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/errors

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.
  File "C:\Users\Dany\Desktop\FYP\Python files\NN.py", line 1, in <module>
    import tensorflow as tf
David Buck
  • 3,752
  • 35
  • 31
  • 35
Jenny
  • 375
  • 4
  • 6
  • 25
  • seems like they already gave you a link to check. Did you look into it? Becase when looking into it they already have an issue linked that looks like yours: https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso – TryToSolveItSimple Apr 01 '20 at 14:35
  • 1
    Does this answer your question? [On Windows, running "import tensorflow" generates No module named "\_pywrap\_tensorflow" error](https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso) – TryToSolveItSimple Apr 01 '20 at 14:36
  • I installed python 3.5.3, and now I have another error : – Jenny Apr 02 '20 at 18:27
  • I installed python 3.5.3, and now I have another error : ImportError: DLL load failed: The specified module could not be found. So I tried to look here https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso and install lib MSVCP140.DLL but it didn't work I think it doesn't match my version – Jenny Apr 02 '20 at 18:34

1 Answers1

0

I installed Python 3.8 and TensorFlow 1.12 on Windows 8

This combination doesn't work. Python 3.8 was not supported when tensorflow (i.e TF) was at version 1.12. It only support when TF (2.2.0rc1,2.2.0rc2). Please check on pypi, there are no files available for cp38 for 1.12.

If you are looking for compatible python versions for TF 1.12 are 3.5 to 3.7. If you are facing any issues with this installation there may be reason with compiler please install MSVC 2015 update 3.

enter image description here

Please refer TF tested build configuration details for CPU and GPU.

If you don't have any concerns with TF version, I recommend you please install TF 2 which works on Windows 8 64-bit system. Please refer more details here.

Note: After installation TF 2, if you are facing any DLL issues. Possible scenarios are

  1. You need to install the MSVC 2019
  2. Your CPU/Python is on 32 bits
  3. Your CPU does not support AVX2 instructions
  4. There is a library that is in a different location/not installed on your system that cannot be loaded.