conda导入sklearn时ImportError: DLL load failed while importing _arpack: 找不到指定模块

在anaconda官方网站安装的anaconda3

完全没动过安装包,也没有安装过什么包,但是在jupyter lab里面导入sklearn会报错:

ImportError: DLL load failed while importing _arpack: The specified procedure could not be found.

之前看大佬帖子说:

在prompt 里conda uninstall scipy卸载scipy(这样会同时卸载scipy 和 sklearn)

再重新安装scipy和scikitlearn

这个方法我第一次遇到这个问题的时候,管用了,但是我后续安装处理不平衡数据包imblearn时安装不成功(说scipy 和 sklearn版本不合适)

而且,今天不知道为什么 报了错,采用上面的方法也不可以——卸载scipy后无法再次安装,提示: Could not install packages due to an OSError: [Errno 2] No such file or directory: ‘d:\users\xxxx\appdata\local\continuum\anaconda3\envs\faiss\lib\site-packages\numpy-1.20.3.dist-info\METADATA’ (大概这种)

scipy都没法安装更别说scikit-learn了

然后去查阅这种报错方式的解决办法,如:进入报错路径,将之前版本包中的安装文件复制到新版本文件中。 仍然报错

于是,各种乱试,试到这个方法:

首先要卸载重装anaconda,不然会失败(除非anaconda什么包都没安装过)

在anaconda prompt里

anaconda prompt环境
pip uninstall scipy # 查看conda list 发现仅卸载了scipy 而不会卸载scikit-learn
重新安装
pip install scipy

莫名其妙就好了

我看其他帖子说 conda里的scipy是自带的 我觉得可能带点问题(缺点什么)

ps.之前安装imblearn 用的是conda install 方法 总是失败

后来直接在prompt里面pip install imblearn就好了

Original: https://blog.csdn.net/m0_57194506/article/details/121161191
Author: 爱吃自助烤肉
Title: conda导入sklearn时ImportError: DLL load failed while importing _arpack: 找不到指定模块

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/771498/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球