Used by oneself conda Created python, Installed Pytorch Environmental Science , stay jupyter It can be used normally , The command line can also be used normally , But with Pycharm When creating a new project , Use conda Created Python Environmental Science , In the normal py In file import Times wrong , And the console is import Report errors .
Because that's right on the command line , stay Pycharm Use error in , The environment may not be configured properly , It reports an error that the module cannot be found , That is, its environment directory is not put in , The solution is as follows
Error reporting form :
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.6 from "D:\APP\Anaconda\envs\torch\python.exe"
* The NumPy version is: "1.19.2"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: DLL load failed: The specified module was not found .
resolvent :
Click on Edit Configurations->Environment variables-> File Icon ->±> Input conda Configured Python Environment path related parameters : Parameter is own Python Environmental Science , Make it your own
D:\APP\Anaconda;
D:\APP\Anaconda\Library\mingw-w64\bin;
D:\APP\Anaconda\Library;
D:\APP\Anaconda\Lib\site-packages;
D:\APP\Anaconda\Scripts;
D:\APP\Anaconda\envs\torch\Library\bin;
Results show :
terms of settlement :
file->Settings-> Search for Python Console->Environment variables-> Enter the above parameters : Parameter is own Python Environmental Science , Make it your own
D:\APP\Anaconda;
D:\APP\Anaconda\Library\mingw-w64\bin;
D:\APP\Anaconda\Library;
D:\APP\Anaconda\Lib\site-packages;
D:\APP\Anaconda\Scripts;
D:\APP\Anaconda\envs\torch\Library\bin;
Result display :