Python 官方文档:入门教程 => 点击学习
问题 你在运行python代码的时候,是否遇到过下面这种错误 ImportError: Unable to import required dependencies:numpy: IMPORTANT:
你在运行python代码的时候,是否遇到过下面这种错误
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 formany reasons, often due to issues with your setup or how NumPy wasinstalled.We have compiled some common reasons and troubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.htmlPlease note and check the following: * The Python version is: python3.7 from "C:\Users\MSI-NB\.conda\envs\python37\python.exe" * The NumPy version is: "1.21.6"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: 找不到指定的模块。
如上信息所示,我的python版本是3.7,Numpy版本是1.21.6,他们的版本不匹配,导致运行报错。
通过安装对应的版本号,python3.7对应的是numpy1.19.5,直接按照对应版本即可。
如果你使用的pip,只需要执行
pip uninstall numpypip install numpy==1.19.5
如果你使用的是conda,需要执行
conda uninstall numpyconda install numpy==1.19.5
那么如何知道他们的对应关系呢,这个网站你一定要收藏
Https://www.lfd.uci.edu/~Gohlke/pythonlibs/
在这里,你能够看到所有python库和python版本的对应关系。以pandas为例,如下图所示,cp后面指的就是python版本,cp39就是python3.9,那么它对应的pandas版本就是pandas==1.3.5
如果依然无法解决你的问题,可以尝试安装numpy-base
conda install -c anaconda numpy-base
如果依旧没有解决,你可以看下你的pip下和conda下是不是都有Numpy,通过执行pip list 和conda list,如果是的话,需要将pip种的删除,pip uninstall numpy.
不过的执行后,又报了另外一个错误,
~\.conda\envs\python37\lib\site-packages\pandas\_typing.py in 82 # array-like 83 ---> 84 ArrayLike = UNIOn["ExtensionArray", np.ndarray] 85 AnyArrayLike = Union[ArrayLike, "Index", "Series"] 86 AttributeError: module 'numpy' has no attribute 'ndarray'
这个报错是因为numpy和panda版本不匹配导致的,需要卸载后重新安装,注意,需要先安装numpy,再安装pandas
来源地址:https://blog.csdn.net/jingyoushui/article/details/131617859
--结束END--
本文标题: numpy与python版本不匹配-ImportError: Unable to import required dependencies: numpy
本文链接: https://www.lsjlt.com/news/410929.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
一口价域名售卖能注册吗?域名是网站的标识,简短且易于记忆,为在线用户提供了访问我们网站的简单路径。一口价是在域名交易中一种常见的模式,而这种通常是针对已经被注册的域名转售给其他人的一种方式。
一口价域名买卖的过程通常包括以下几个步骤:
1.寻找:买家需要在域名售卖平台上找到心仪的一口价域名。平台通常会为每个可售的域名提供详细的描述,包括价格、年龄、流
443px" 443px) https://www.west.cn/docs/wp-content/uploads/2024/04/SEO图片294.jpg https://www.west.cn/docs/wp-content/uploads/2024/04/SEO图片294-768x413.jpg 域名售卖 域名一口价售卖 游戏音频 赋值/切片 框架优势 评估指南 项目规模 安全指南 Osprey 游戏分析 游戏调试 游戏图形 游戏物理 开源库 魔方破解 游戏安全 反作弊 安全最佳实践 游戏逻辑
0