0

I installed tensorflow 1.12.0.while impoting tensorflow in python3.9.1..faced error below

ImportError Traceback (most recent call last) c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper() 17 try: ---> 18 fp, pathname, description = imp.find_module('_pywrap_tensorflow_internal', [dirname(file)]) 19 except ImportError:

c:\users\renis\appdata\local\programs\python\python39\lib\imp.py in find_module(name, path) 295 else: --> 296 raise ImportError(_ERR_MSG.format(name), name=name) 297

ImportError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

ModuleNotFoundError Traceback (most recent call last) c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 57 ---> 58 from tensorflow.python.pywrap_tensorflow_internal import * 59 from tensorflow.python.pywrap_tensorflow_internal import version

c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in 27 return _mod ---> 28 _pywrap_tensorflow_internal = swig_import_helper() 29 del swig_import_helper

c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper() 19 except ImportError: ---> 20 import _pywrap_tensorflow_internal 21 return _pywrap_tensorflow_internal

ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'

During handling of the above exception, another exception occurred:

ImportError Traceback (most recent call last) in ----> 1 import tensorflow

c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow_init_.py in 22 23 # pylint: disable=g-bad-import-order ---> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import 25 26 try:

c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python_init_.py in 47 import numpy as np 48 ---> 49 from tensorflow.python import pywrap_tensorflow 50 51 from tensorflow.python.tools import component_api_helper

c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in 72 for some common reasons and solutions. Include the entire stack trace 73 above this error message when asking for help.""" % traceback.format_exc() ---> 74 raise ImportError(msg) 75 76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long

ImportError: Traceback (most recent call last): File "c:\users\renis\appdata\local\programs\python\python39\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\renis\appdata\local\programs\python\python39\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\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File "c:\users\renis\appdata\local\programs\python\python39\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "c:\users\renis\appdata\local\programs\python\python39\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.

​please help to solve this.

Freek W.
  • 406
  • 5
  • 20
  • Does this answer your question? [No Module Named '\_pywrap\_tensorflow\_internal'](https://stackoverflow.com/questions/44080677/no-module-named-pywrap-tensorflow-internal) – Paul Brennan Feb 23 '21 at 14:27

1 Answers1

0

Python 3.9 requires Tensorflow 2.5 or later. You need to upgrade the Tensorflow version as per python.

You can use below code to upgrade the tensorflow:

pip install --upgrade pip
pip install --upgrade tensorflow 

Follow this link to check and install compatible Tensorflow version.