I am trying to install tensorflow in Windows 7 ultimate
Python --verion return
Python 3.7.0
Tensorflow version is 0.12.0
I dont have Anaconda or conda environment installed on PC.
Project requirements prevent me going to colab/kaggle enviroments
I have path to all the requesite dll’s in the PATH env variable
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;F:\app\nakul\product\11.2.0\dbhome_1\bin;
C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Java\jdk1.6.0_18\bin;
C:\Program Files (x86)\nodejs;C:\Program Files\TortoiseHg;
c:\Program Files\Mozilla Firefox;
C:\Program Files\Mozilla Firefox;C:\Program Files (x86)\Java\jdk1.8.0_45\bin
;H:\Softwares\apache-maven-3.8.1-bin\apache-maven-3.8.1\bin;
C:\Windows\System32\WindowsPowerShell\v1.0;
C:\Windows\system;
C:\Program Files\Mozilla Firefox;
H:\Python Installed\Scripts;
H:\Python Installed;
C:\Users\nakul\AppData\Roaming\npm;
I:\MikiTextInstall\miktex\bin\x64;
C:\Users\nakul\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;
C:\Program Files\JetBrains\IntelliJ IDEA 2019.2.4\bin;;
C:\Program Files\Mozilla Firefox;F:\MS\Microsoft VS Code\bin;
H:\Softwares\apache-maven-3.8.1-bin\apache-maven-3.8.1\bin;
F:\data sciece\vivek;C:\Users\nakul\AppData\Local\Pandoc;
H:\Python Installed\Lib\site-packages\graphviz;search-ms:displayname=Search%20Results%20in%20Python%20Installed&crumb=location:H%3A%5CPython%20Installed\graphviz-0.19.1.dist-info;C:\Windows\SysWOW64;C:\Windows\System32;C:\Windows\winsxs\x86_microsoft-windows-u…rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.23303_none_4e5c9e3785a6634a;
H:\Python Installed;
upon executing import tensorflow as tf i get following error:
ImportError Traceback (most recent call last)
h:\python installed\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in swig_import_helper()
17 try:
—> 18 fp, pathname, description = imp.find_module(‘_pywrap_tensorflow’, [dirname(file)])
19 except ImportError:
h:\python installed\lib\imp.py in find_module(name, path)
296 else:
→ 297 raise ImportError(_ERR_MSG.format(name), name=name)
298
ImportError: No module named ‘_pywrap_tensorflow’
During handling of the above exception, another exception occurred:
ModuleNotFoundError Traceback (most recent call last)
h:\python installed\lib\site-packages\tensorflow\python_init_.py in
53 # use dlopen()
for dynamic loading.
—> 54 from tensorflow.python import pywrap_tensorflow
55 except ImportError:
h:\python installed\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in
27 return _mod
—> 28 _pywrap_tensorflow = swig_import_helper()
29 del swig_import_helper
h:\python installed\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in swig_import_helper()
19 except ImportError:
—> 20 import _pywrap_tensorflow
21 return _pywrap_tensorflow
ModuleNotFoundError: No module named ‘_pywrap_tensorflow’
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
in
----> 1 import tensorflow as tf
2 from tensorflow.keras.utils import to_categorical
h:\python installed\lib\site-packages\tensorflow_init_.py in
22
23 # pylint: disable=wildcard-import
—> 24 from tensorflow.python import *
25 # pylint: enable=wildcard-import
26
h:\python installed\lib\site-packages\tensorflow\python_init_.py in
58 please exit the tensorflow source tree, and relaunch your python interpreter
59 from there.“”" % traceback.format_exc()
—> 60 raise ImportError(msg)
61
62 # Protocol buffers
ImportError: Traceback (most recent call last):
File “h:\python installed\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 18, in swig_import_helper
fp, pathname, description = imp.find_module(‘_pywrap_tensorflow’, [dirname(file)])
File “h:\python installed\lib\imp.py”, line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named ‘_pywrap_tensorflow’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “h:\python installed\lib\site-packages\tensorflow\python_init_.py”, line 54, in
from tensorflow.python import pywrap_tensorflow
File “h:\python installed\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 28, in
_pywrap_tensorflow = swig_import_helper()
File “h:\python installed\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 20, in swig_import_helper
import _pywrap_tensorflow
ModuleNotFoundError: No module named ‘_pywrap_tensorflow’
Error importing tensorflow. Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.
I have tried solutions mentioned at following urls:-
- ImportError: No module named '_pywrap_tensorflow_internal' · Issue #48267 · tensorflow/tensorflow · GitHub
- ImportError: No module named '_pywrap_tensorflow' Failed to load the native TensorFlow runtime. · Issue #8385 · tensorflow/tensorflow · GitHub
- Invalid syntax error while importing tensorflow in python3.7.0 · Issue #20690 · tensorflow/tensorflow · GitHub
(Reported the same issue there as well)
Any leads on how to solve this problem?
Thanking You
sunforu