当前位置:   article > 正文

python导入Numpy失败,ImportError: Unable to import required dependencies: numpy:

importerror: unable to import required dependencies: numpy: dll load failed
ImportError: Unable to import required dependencies:
numpy:
 
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.7 from "D:\tools\Anaconda\envs\pytorch\python.exe"
* The NumPy version is: "1.21.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 while importing _multiarray_umath: 找不到指定的模块。
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

看这个报错信息,是python版本与Numpy版本不匹配,
我这Python3.7版本 应该匹配Numpy1.16.4版本
因此卸载NumPy1.21.2,重新安装。

1、打开Anaconda Prompt的命令行窗口
2、输入 pip uninstall numpy。 卸载 numpy 1.21.2
3、pip install numpy==1.16.4。 安装numpy 1.16.4
成功后关闭Anaconda Prompt的命令行窗口再重新打开即可
  • 1
  • 2
  • 3
  • 4

问题已解决
在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/595770
推荐阅读
相关标签
  

闽ICP备14008679号