[英]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.