【发布时间】:2016-12-04 16:37:49
【问题描述】:
我是 Python 新手。因此,如果这听起来很愚蠢,请提前抱歉,但我在论坛中找不到可以理解的解决方案。我正在尝试在 Pycharm 中运行我的程序,最近将其从 Python 3.5 更改为 Python 2.7.12。这样做之后,我在从 Scikit-learn 导入时开始收到以下错误:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/__check_build/__init__.py", line 46, in <module>
raise_build_error(e)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/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 init function (init_check_build)
___________________________________________________________________________
Contents of /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/sklearn/__check_build:
__init__.py __init__.pyc _check_build.so
setup.py setup.pyc
___________________________________________________________________________
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.
Process finished with exit code 1
我正在使用 Pycharm IDE - 2016.1、Mac OS、Python 2.7.12。请告诉我如何解决这个问题。
谢谢
【问题讨论】:
标签: python python-2.7 python-3.x scikit-learn pycharm