问题
I can import tensorflow in my home directory but when I change to project directory I am getting import error as you can see in below screenshot
You can see the project folder content also in the screenshot, even if I remove the __pycache__
folder it recreates it again with the same error.
Last line of error:ImportError: cannot import name 'constant' from partially initialized module 'tensorflow.python.framework.constant_op' (most likely due to a circular import) (/home/prakhar/.local/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py)
Version details:
- Python version: 3.8.2
- Tensorflow version: 2.3.1
- No CUDA installed since I do not need GPU support
来源:https://stackoverflow.com/questions/64555814/cannot-import-tensorflow-inside-the-project-folder