[ Note] pycharm imports the tensorflow package and reports an error
If you also encounter this problem, it means you don’t understand where tensorflow is
After installing Anaconda 3.6, set interpreter in pycharm. This interpreter determines how to execute the code you write in pycharm environment
If your setting is python.exe under anaconda. You will find that import tensorflow is written in pycharm When as TF, an error will be reported, indicating that there is no tensorflow module. This is because python.exe in Anaconda file is version 3.6, and the CONDA environment you created is under anaconda, and the tensorflow you installed is in CONDA environment, not Anaconda environment. Therefore, if you want to import tensorflow, you need to select python.exe in CONDA environment as the interpreter
When your interpreter selects python.exe under Anaconda in the red box shown in the figure below, you will be prompted that the tensorflow module is not found when importing tensorflow in pycharm environment
If you want to use tensorflow, the interpreter should choose the following path (Anaconda – > envs-> tenfowflow-> Python.exe under python. Exe)
The correct selection of the interpreter is shown in the figure. Click the setting button indicated by the arrow in the figure below, select add local, and select python.exe of the path shown in the figure above instead of python.exe under anaconda. After selecting python.exe under CONDA environment, the settings shown in the red box in the figure below will be displayed
Similar Posts:
- Error in importing tensorflow in Jupiter Notebook: no module named tensorflow solution
- jupyter notebook error: No module named ‘tensorflow’
- Pycharm introduces numpy error: ImportError: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of numpy.
- How to Solve Anaconda Error: PackageNotFoundError: Package not found: ” Package missing in current win-64 channels
- Pycharm ImportError: No module named selenium [How to Solve]
- Project interpreter not specified(eclipse+pydev)
- [Solved] Tensorflow:ImportError: DLL load failed: The specified module cannot be found Failed to load the native TensorFlow runtime
- How to Solve Anaconda Error (Three Errors to Solve)
- PIP Python package succeeds, but an error is reported when importing
- Mac pychar import Jieba error resolution