简体   繁体   English

DLL加载失败:导入scipy时找不到指定的模块

[英]DLL load failed: The specified module could not be found while importing scipy

I have installed python with Anaconda on windows 10. I have created a virtual environment with Anaconda called venv . 我已经安装了Python与蟒蛇在Windows 10,我已创建了名为蟒蛇虚拟环境venv After activating the environment, >>>python gives: 激活环境后, >>>python给出:

Python 3.6.8 |Anaconda, Inc.| (default, Feb 11 2019, 15:03:47) [MSC v.1915 64 bit (AMD64)] on win32

I have installed scipy in my venv using pip: pip install scipy . 我已经安装scipy在我的venv使用PIP: pip install scipy

I have set the interpreter in pycharm to the venv python interpreter. 我已经将pycharm中的解释器设置为venv python解释器。

在此处输入图片说明

Now, I tried the following in a new module in pycharm: 现在,我在pycharm的新模块中尝试了以下操作:

import scipy    # No error here
from scipy.stats import norm # Here I got the error

Error: 错误:

Traceback (most recent call last):
  File "C:/Users/user/Documents/February2019/AVEC2018/ApplyPCA.py", line 11, in <module>
    from scipy.optimize import _hungarian
  File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\lib\site-packages\scipy\optimize\__init__.py", line 386, in <module>
    from .optimize import *
  File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\lib\site-packages\scipy\optimize\optimize.py", line 37, in <module>
    from .linesearch import (line_search_wolfe1, line_search_wolfe2,
  File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\lib\site-packages\scipy\optimize\linesearch.py", line 18, in <module>
    from scipy.optimize import minpack2
ImportError: DLL load failed: The specified module could not be found.

I have followed the instructions here as an attempt to solve the problem. 我已按照此处的说明尝试解决此问题。

Therefore, I ran print(os.environ['PATH']) while using the venv python interpreter in cmd (ie, after activating venv ); 因此,我在cmd中使用venv python解释器时运行了print(os.environ['PATH']) (即,在激活venv ); I copied the following result 我复制了以下结果

C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv;C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\Library\mingw-w64\bin;C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\Library\usr\bin;C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\Library\bin;C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\Scripts;C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2017a\runtime\win64;C:\Program Files\MATLAB\R2017a\bin;C:\Users\user\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\cuda7\cuda\bin;C:\Program Files\Weka-3-8;C:\Users\user\Downloads\ffmpeg-20170904-6cadbb1-win64-static\bin;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Program Files\Java\jre1.8.0_144\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\user\Downloads\pandoc-2.1.2;C:\Users\user\AppData\Local\Continuum\anaconda3\Scripts;C:\Users\user\AppData\Local\Continuum\anaconda3;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\user\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Users\user\Downloads\cmake-3.11.2-win64-x64\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\CUPTI\libx64;C:\Program Files\NVIDIA Corporation\NVSMI;C:\Users\user\AppData\Local\Microsoft\WindowsApps;C:\Cloud SDK\google-cloud-sdk\bin;C:\altera\13.0\modelsim_ase\win32aloem;C:\Program Files\Microsoft VS Code\bin;C:\Users\user\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;C:\Users\user\AppData\Local\Continuum\anaconda3\envs\venv\lib\site-packages\numpy\.libs

and paste it in a new variable in run/debug configuration and in python console as: 并将其粘贴到运行/调试配置python控制台中的新变量中,如下所示:

在此处输入图片说明

在此处输入图片说明

But that didn't solve the problem. 但这并不能解决问题。 Please note that I tried installing scipy using conda install scipy , and the problem wasn't solved. 请注意,我尝试使用scipy conda install scipy ,但问题尚未解决。 Finally, the problem doesn't arise while working from cmd, but do exist when working from python console (inside pycharm) and pycharm. 最后,在cmd中工作时不会出现此问题,但在python控制台(在pycharm中)和pycharm中工作时确实存在。

I found out that running print(os.environ['PATH']) within the python console inside pycharm gave me the following: 我发现在pycharm内的python控制台中运行print(os.environ['PATH'])给了我以下信息:

C:\Users\iayou005\AppData\Local\Continuum\anaconda3\envs\venv\Library\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\libnvvp;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\MATLAB\R2017a\runtime\win64;C:\Program Files\MATLAB\R2017a\bin;C:\Users\iayou005\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\cuda7\cuda\bin;C:\Program Files\Weka-3-8;C:\Users\iayou005\Downloads\ffmpeg-20170904-6cadbb1-win64-static\bin;C:\Program Files\Java\jdk1.8.0_144\bin;C:\Program Files\Java\jre1.8.0_144\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\iayou005\Downloads\pandoc-2.1.2;C:\Users\iayou005\AppData\Local\Continuum\anaconda3\Scripts;C:\Users\iayou005\AppData\Local\Continuum\anaconda3;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Users\iayou005\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64;C:\Users\iayou005\Downloads\cmake-3.11.2-win64-x64\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\extras\CUPTI\libx64;C:\Program Files\NVIDIA Corporation\NVSMI;C:\Users\iayou005\AppData\Local\Microsoft\WindowsApps;C:\Cloud SDK\google-cloud-sdk\bin;C:\altera\13.0\modelsim_ase\win32aloem;C:\Program Files\Microsoft VS Code\bin;C:\Users\iayou005\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\;

Therefore, the following 2 paths are missing: 因此,缺少以下两个路径:

C:/Users/user/AppData/Local/Continuum/anaconda3/envs/venv;C:/Users/user/AppData/Local/Continuum/anaconda3/envs/venv/Scripts;

I have no idea how to fix this given all the attempts mentioned above 鉴于上述所有尝试,我不知道如何解决此问题

Any help is much appreciated!! 任何帮助深表感谢!!

It seems you have misplaced the name of the environment variable and its value in the configuration dialog. 看来您在配置对话框中放错了环境变量的名称及其值。

It should be PATH=list_of_paths , not list_of_paths=PATH 它应该是PATH=list_of_paths ,而不是list_of_paths=PATH

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入 pyrfc 时 DLL 加载失败:找不到指定的模块 - DLL load failed while importing pyrfc: The specified module could not be found 导入 scipy.stats 时,出现“导入错误:DLL 加载失败:找不到指定的过程” - While importing scipy.stats, gets 'ImportError: DLL load failed: The specified procedure could not be found' 导入 Cartopy 时 ImportError: DLL load failed while importing trace: The specified module could not be found - When importing Cartopy ImportError: DLL load failed while importing trace: The specified module could not be found 导入 Dash 时出错:“ImportError: DLL load failed while importing _brotli: The specified module could not be found.” - Error when importing Dash: "ImportError: DLL load failed while importing _brotli: The specified module could not be found." cx_Freeze ImportError: DLL load failed while importing _ctypes: 找不到指定的模块 - cx_Freeze ImportError: DLL load failed failed while importing _ctypes: The specified module could not be found 加载 psycopg2 模块时出错:导入 _psycopg 时 DLL 加载失败:找不到指定的模块 - Error loading psycopg2 module: DLL load failed while importing _psycopg: The specified module could not be found DLL load failed while importing winpty: the specified procedure could not be found - DLL load failed while importing winpty: The specified procedure could not be found (ibm_db) ImportError: DLL load failed while importing ibm_db: The specified module could not be found - (ibm_db) ImportError: DLL load failed while importing ibm_db: The specified module could not be found 导入错误:导入 _openmp_helpers 时 DLL 加载失败:找不到指定的模块 - ImportError: DLL load failed while importing _openmp_helpers: The specified module could not be found ImportError: DLL load failed while importing pymqe: The specified module could not be found - ImportError: DLL load failed while importing pymqe: The specified module could not be found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM