我成功安装了numpy-1.13.1+mkl-cp36-cp36m-win32 .whl和scipy-0.19.1-cp36-cp36m-win32.whl,然后我成功安装了scikit-learn,但是当我运行导入sklearn时,Pycharm给了我错误。如何消除此问题?我在Windows 3.6(32位)上安装了python10(64位)。
import sklearn
运行结果:
C:UsersEmertatAppDataLocalProgramsPythonPython36-32python.exe "F:/Python/NS videos/cedes/Exercise 07 test.py"
Traceback (most recent call last):
File "F:/Python/NS videos/cedes/Exercise 07 test.py", line 21, in <module>
import sklearn
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagessklearn__init__.py", line 134, in <module>
from .base import clone
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagessklearnbase.py", line 12, in <module>
from .utils.fixes import signature
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagessklearnutils__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagessklearnutilsvalidation.py", line 18, in <module>
from ..utils.fixes import signature
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagessklearnutilsfixes.py", line 144, in <module>
from scipy.sparse.linalg import lsqr as sparse_lsqr # noqa
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagesscipysparselinalg__init__.py", line 117, in <module>
from .matfuncs import *
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagesscipysparselinalgmatfuncs.py", line 19, in <module>
import scipy.special
File "C:UsersEmertatAppDataLocalProgramsPythonPython36-32libsite-packagesscipyspecial__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified procedure could not be found.
Process finished with exit code 1
首先,使用以下命令从您的 Windows 操作系统中删除 sklearn-
pip uninstall scikit-learn
然后,您需要从他们自己的官方安装程序中安装 numpy 和 scipy。
用于pypi scikit-learn 的轮子包(.whl 文件)可以使用 pip 实用程序安装。打开控制台并键入以下内容以安装或升级到最新的稳定版本:
pip install -U scikit-learn
如果没有与您的python匹配的二进制软件包,您可以尝试从Christoph Gohlke非官方Windows安装程序或python发行版安装scikit-learn及其依赖项。