程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Solve the import error when pychart console uses the python environment configured by CONDA

編輯:Python

Pycharm Console Use conda Configured Python Environmental time import Error reporting solution

    • 1、 Wrong background
    • 2、 The reason for the error
    • 3、 Problem solving
      • 3.1、py File error reporting solution
      • 3.2 .console Error reporting solution

1、 Wrong background

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 .

2、 The reason for the error

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

3、 Problem solving

3.1、py File error reporting solution

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 :

3.2 .console Error reporting solution

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 :


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved