Error when trying to import sklearn modules : ImportError: DLL load failed: The specified module could not be found

China☆狼群 提交于 2019-12-01 17:52:33
Joseph Lemien

You should open up "C:\Python27\lib\site-packages\sklearn\utils\fixes.py", and edit the contents. There are two specific changes you should make:

First, copy-and-paste the contents of https://github.com/scikit-learn/scikit-learn/blob/74a9756fa784d1f22873ad23c8b4948c6e290108/sklearn/utils/fixes.py into the file "C:\Python27\lib\site-packages\sklearn\utils\fixes.py".

Second, replace the line if np_version < (1, 12, 0): with if np_version < (1, 12):.

More background info and detail available here, in a great answer from user DSM.

This line points to scipy.

from scipy.sparse.linalg import lsqr as sparse_lsqr

You can try:

pip uninstall scipy

pip install scipy

enjoy!

Install this numpy library instead of the one you use:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

I assume you have Intel Math Kernal Libary installed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!