且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

尝试导入sklearn模块时出错:ImportError:DLL加载失败:找不到指定的模块

更新时间:2023-10-18 12:26:04

您应该打开"C:\ Python27 \ lib \ site-packages \ sklearn \ utils \ fixes.py",然后编辑内容.您应该进行两项具体更改:

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:

首先,复制并粘贴 https://github.com/scikit-learn/scikit-learn/blob/74a9756fa784d1f22873ad23c8b4948c6e290108/sklearn/utils/fixes.py 放入文件"C:\ Python27 \ lib \ site-packages \ sklearn \ utils \ fixes.py".

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".

第二,将np_version < (1, 12, 0):替换为if np_version < (1, 12):.

可在此处获得更多背景信息和详细信息,这是用户DSM .

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