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

发布时间:2024年01月08日
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: 找不到指定的模块。

看这个报错信息,是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的命令行窗口再重新打开即可

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

文章来源:https://blog.csdn.net/qq_30353203/article/details/135468617
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。