ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

conda 环境下 调用 sklearn库 时出现 许多包依赖错误 比如:ImportError: DLL load failed while importing _arpack:

2020-12-12 18:59:59  阅读:2218  来源: 互联网

标签:load pip3 ImportError scikit DLL scipy conda install learn


问题场景:

conda 环境下的python 包管理,python 版本3.8.3 

现项目需要使用到sklearn库


问题描述:

调用sklearn库需要安装scikit-learn

按照网上的scikit-learn的依赖库安装顺序,安装完一下后再使用conda install scikit-learn

  • Python (>= 3.5),
  • NumPy (>= 1.11.0),
  • SciPy (>= 0.17.0),

调用库函数时出现ImportError: DLL load failed while importing _arpack: The specified procedure could not be found.


原因分析:

报错代码段出现到scipy 库的追溯,因此和scipy的安装有关

  from scipy.sparse.linalg import LinearOperator

 


解决方案:

使用conda uninstall scipy 然后重新安装依然报错,

  1. 使用conda uninstall scipy (此过程会自动uninstall scikit-learn)
  2. 使用pip3 install -U scipy,并且使用pip3 install scikit-learn
  3. 在使用pip3安装库时,会出现下述错误
    ERROR: Could not find a version that satisfies the requirement scikit-learn  
    ERROR: No matching distribution found for scikit-learn

    解决方法:使用临时镜像源添加,并给与镜像源trust,像下面这样

pip3 install -U scikit-learn -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

最后,注意使用pip3而不是pip安装

标签:load,pip3,ImportError,scikit,DLL,scipy,conda,install,learn
来源: https://blog.csdn.net/leisure2222222/article/details/111080008

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有