微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决导入错误:导入 _multiarray_umath 时 DLL 加载失败:找不到指定的模块

我正在 Windows 中使用 anaconda 和一些软件包创建一个新环境

conda create -n myenv
conda activate myenv

conda install python
conda install cvxopt
conda install gym
conda install networkx
conda install pandas
conda install matplotlib

它安装了以下版本:

python-3.9.2
cvxopt-1.2.6
gym-0.18.0
networkx-2.5
pandas-1.2.3
matplotlib-3.3.4

当我尝试运行任何导入 numpy 的简单代码时:我收到以下错误

Traceback (most recent call last):
  File "C:\Users\kkris\anaconda3\envs\cbf_gym\lib\site-packages\numpy\core\__init__.py",line 22,in <module>  
    from . import multiarray
  File "C:\Users\kkris\anaconda3\envs\cbf_gym\lib\site-packages\numpy\core\multiarray.py",line 12,in <module>
    from . import overrides
  File "C:\Users\kkris\anaconda3\envs\cbf_gym\lib\site-packages\numpy\core\overrides.py",line 7,in <module>  
    from numpy.core._multiarray_umath import (
ImportError: DLL load Failed while importing _multiarray_umath: The specified module Could not be found.       

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "c:\Users\kkris\Documents\GitHub\DC-microgrids\run_microgrid.py",line 1,in <module>
    import numpy as np
  File "C:\Users\kkris\anaconda3\envs\cbf_gym\lib\site-packages\numpy\__init__.py",line 145,in <module>      
    raise ImportError(msg)
ImportError:

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.9 from "C:\Users\kkris\anaconda3\envs\cbf_gym\python.exe"
  * The NumPy version is: "1.20.1"

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 while importing _multiarray_umath: The specified module Could not be found.

我验证了我的 anaconda 和准确路径变量以及我以前的环境是否正常工作。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。