Tensorflow import error, cannot import the module pywrap_tensorflow from partially initialize module

Viewed 439

I'm starting to doing Machine Learning with Tensorflow, but when I install and try to import it. I was seeing to similar issues and to fix it I need to go out the directory in which the tensorflow is installing, but I try going to C:/ and to go to a directory when I do my projects and it doesn't work.

The error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Felipe Garcia\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "C:\Users\Felipe Garcia\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
ImportError: cannot import name 'pywrap_tensorflow' from partially initialized module 'tensorflow.python' (most likely due to a circular import) (C:\Users\Felipe Garcia\AppData\Local\Programs\Python\Python38-32\lib\site-packages\tensorflow\python\__init__.py)

Thanks for all

1 Answers

Follow these steps to install Tensorflow by creating virtual environment

python -m venv --system-site-packages .\venv
.\venv\Scripts\activate
pip install --upgrade pip
pip install --upgrade tensorflow
#Verify the install:
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
Related