Error When Importing tensorflow | Sololearn: Learn to code for FREE!

+1

Error When Importing tensorflow

Hi Guys,I Tried To Run A File That Has One Statement Which Is: import tensorflow But This Error Happens Occurs: Traceback (most recent call last): File "C:\Users\max\PycharmProjects\untitled\venv\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\max\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\max\PycharmProjects\untitled\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Users\max\PycharmProjects\untitled\venv\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Users\max\PycharmProjects\untitled\venv\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 "E:/Ahmad's Programs/test.py", line 1, in <module> import tensorflow.python File "C:\Users\max\PycharmProjects\untitled\venv\lib\site-packages\tensorflow\__init__.py", line 24, in <module> from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File "C:\Users\max\PycharmProjects\untitled\venv\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "C:\Users\max\PycharmProjects\untitled\venv\lib\site-packages\tensorflow\python

5/14/2020 9:12:16 PM

Ahmad Tarek

5 Answers

New Answer

+2

you need to install tensorflow module before using it. you can either do it through the console(command prompt) using this command pip install tensorflow for python 2 pip3 install tensorflow for python 3 or since you use PyCharm you can install it through the virtual environement (venv) you are using following these instructions: https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

+2

Ahmad Tarek and it's still not working?

+1

Sebastian Pacurar I Have Already Installed It

+1

Sebastian Pacurar Yes

+1

Ahmad Tarek maybe one of these options might help https://stackoverflow.com/questions/42011070/on-windows-running-import-tensorflow-generates-no-module-named-pywrap-tenso