[英]Sklearn __init__.py error
我尝试通过.whl
文件中的pip安装Sklearn时收到错误。
我已经阅读了有关卸载Sklearn的所有现有注释,并在安装Numpy&Scipy后访问http://www.lfd.uci.edu/~gohlke/pythonlibs/下载文件。
无论出于何种原因,我都会收到以下错误:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import sklearn
File "C:\Users\username\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\__init__.py", line 57, in <module>
from .base import clone
File "C:\Users\username\AppData\Local\Programs\Python\Python35\lib\site-packages\sklearn\base.py", line 9, in <module>
from scipy import sparse
File "C:\Users\username\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\sparse\__init__.py", line 214, in <module>
from .csr import *
File "C:\Users\username\AppData\Local\Programs\Python\Python35\lib\site-packages\scipy\sparse\csr.py", line 13, in <module>
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
ImportError: DLL load failed: The specified module could not be found.
我有安装了Python 3.5 64位的Windows 7。 我可以毫无问题地导入Numpy&Scipy只是Sklearn不起作用。
我也尝试过运行setup.py
文件,但这并没有解决问题。
尝试在python脚本中导入scikit-learn时遇到了同样的错误。
我的配置:Python v3.4; 平台= Windows 10。
我在这里解决了这个问题:
笔记:
这是我拥有的所有库的列表:
$ pip list --format=columns
Package Version
------------------- ----------
appdirs 1.4.2
backports-abc 0.5
bleach 1.5.0
colorama 0.3.7
cycler 0.10.0
decorator 4.0.11
entrypoints 0.2.2
html5lib 0.9999999
ipykernel 4.5.2
ipython 5.3.0
ipython-genutils 0.1.0
ipywidgets 5.2.2
Jinja2 2.9.5
jsonschema 2.6.0
jupyter 1.0.0
jupyter-client 5.0.0
jupyter-console 5.1.0
jupyter-core 4.3.0
MarkupSafe 0.23
matplotlib 2.0.0
mistune 0.7.3
mpmath 0.19
nbconvert 5.1.1
nbformat 4.3.0
nose 1.3.7
notebook 4.4.1
numpy 1.12.0+mkl
packaging 16.8
pandas 0.19.2
pandocfilters 1.4.1
pickleshare 0.7.4
pip 9.0.1
prompt-toolkit 1.0.13
Pygments 2.2.0
pyparsing 2.1.10
python-dateutil 2.6.0
pytz 2016.10
pyzmq 16.0.2
qtconsole 4.2.1
scikit-learn 0.18.1
scipy 0.19.0rc2
setuptools 34.3.0
simplegeneric 0.8.1
six 1.10.0
sympy 1.0
testpath 0.3
tornado 4.4.2
traitlets 4.3.2
wcwidth 0.1.7
widgetsnbextension 1.2.6
win-unicode-console 0.5
希望它有所帮助!
作为Ant0nin解决方案的替代方案,我建议您安装Anaconda软件包:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.