我正在运行Mac OS 10.10.5。和Python 3和XCode 7.2.1。我用pip(PyCharm)安装了SciKit-Learn及其所有依赖项,当我尝试使用该软件包时出现此错误。我在另一台运行10.10.5的计算机上尝试过,但没有收到错误。以下是完整的错误消息:
/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 /Users/jonathankogan/PycharmProjects/Test/test.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build/__init__.py", line 44, in <module>
from ._check_build import check_build
ImportError: dynamic module does not define module export function (PyInit__check_build)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jonathankogan/PycharmProjects/Test/test.py", line 2, in <module>
from sklearn import datasets
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__init__.py", line 56, in <module>
from . import __check_build
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build/__init__.py", line 41, in raise_build_error
%s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
ImportError: dynamic module does not define module export function (PyInit__check_build)
___________________________________________________________________________
Contents of /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/sklearn/__check_build:
__init__.py __pycache__ _check_build.cpython-35m-darwin.so
setup.py
___________________________________________________________________________
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run `python setup.py install` or
`make` in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.