导入 sklearn.utils._logistic_sigmoid 个模块时出错
Error importing sklearn.utils._logistic_sigmoid modules
我已经从 Christoph Gohlke Unofficial Windows installers 安装了 scipy
和 scikit-learn
,并且以下命令 运行 成功无误:
>>> import sklearn
>>> import scipy
然后我打算尝试 sklearn.datasets.load_digits()
链接文档中演示的功能:
from sklearn.datasets import load_digits
但该行触发了一个错误,据我所知,_log_logistic_sigmoid
未找到:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from sklearn.datasets import load_digits
File "C:\Python27\lib\site-packages\sklearn\datasets\__init__.py", line 23, in <module>
from .twenty_newsgroups import fetch_20newsgroups
File "C:\Python27\lib\site-packages\sklearn\datasets\twenty_newsgroups.py", line 53, in <module>
from ..feature_extraction.text import CountVectorizer
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\__init__.py", line 10, in <module>
from . import text
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\text.py", line 29, in <module>
from ..preprocessing import normalize
File "C:\Python27\lib\site-packages\sklearn\preprocessing\__init__.py", line 6, in <module>
from .data import Binarizer
File "C:\Python27\lib\site-packages\sklearn\preprocessing\data.py", line 19, in <module>
from ..utils.extmath import row_norms
File "C:\Python27\lib\site-packages\sklearn\utils\extmath.py", line 23, in <module>
from ._logistic_sigmoid import _log_logistic_sigmoid
ImportError: DLL load failed: The specified module could not be found.
有人遇到过这个错误吗?如何解决?
如果有帮助,我正在 windows 8 机器上使用 python 2.7。
通过卸载非官方包解决,然后使用以下命令从官方包重新安装:
pip install -U numpy scipy scikit-learn
我已经从 Christoph Gohlke Unofficial Windows installers 安装了 scipy
和 scikit-learn
,并且以下命令 运行 成功无误:
>>> import sklearn
>>> import scipy
然后我打算尝试 sklearn.datasets.load_digits()
链接文档中演示的功能:
from sklearn.datasets import load_digits
但该行触发了一个错误,据我所知,_log_logistic_sigmoid
未找到:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
from sklearn.datasets import load_digits
File "C:\Python27\lib\site-packages\sklearn\datasets\__init__.py", line 23, in <module>
from .twenty_newsgroups import fetch_20newsgroups
File "C:\Python27\lib\site-packages\sklearn\datasets\twenty_newsgroups.py", line 53, in <module>
from ..feature_extraction.text import CountVectorizer
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\__init__.py", line 10, in <module>
from . import text
File "C:\Python27\lib\site-packages\sklearn\feature_extraction\text.py", line 29, in <module>
from ..preprocessing import normalize
File "C:\Python27\lib\site-packages\sklearn\preprocessing\__init__.py", line 6, in <module>
from .data import Binarizer
File "C:\Python27\lib\site-packages\sklearn\preprocessing\data.py", line 19, in <module>
from ..utils.extmath import row_norms
File "C:\Python27\lib\site-packages\sklearn\utils\extmath.py", line 23, in <module>
from ._logistic_sigmoid import _log_logistic_sigmoid
ImportError: DLL load failed: The specified module could not be found.
有人遇到过这个错误吗?如何解决?
如果有帮助,我正在 windows 8 机器上使用 python 2.7。
通过卸载非官方包解决,然后使用以下命令从官方包重新安装:
pip install -U numpy scipy scikit-learn