导入错误:导入 _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 (将#修改为@)