我們在導入sklearn時往往會報錯。 折騰了一下午之後的解決方案:1.shadowsocks翻牆,解決pip官網下載速度問題。2.用pip在anaconda Scripts目錄中卸載numpy,scipy,matplotlib,skicit-learn相關。 命令:pip uninstall nu ...
我們在導入sklearn時往往會報錯。
import sklearn Traceback (most recent call last): File "<stdin>", line 1, in <module> File "sklearn/__init__.py", line 37, in <module> from . import __check_build File "sklearn/__check_build/__init__.py", line 46, in <module> raise_build_error(e) File "sklearn/__check_build/__init__.py", line 41, in raise_build_error %s""" % (e, local_dir, ''.join(dir_content).strip(), msg)) ImportError: No module named _check_build ___________________________________________________________________________ Contents of sklearn/__check_build: __init__.py __init__.pyc _check_build.c _check_build.pyx 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.
折騰了一下午之後的解決方案:
1.shadowsocksFQ,解決pip官網下載速度問題。
2.用pip在anaconda Scripts目錄中卸載numpy,scipy,matplotlib,skicit-learn相關。
命令:pip uninstall numpy
3.在anaconda Scripts目錄中重裝numpy,scipy,matplotlib,最後安裝skicit-learn。
命令:pip install numpy
成功解決問題,開心到飛起。
https://blog.csdn.net/wyc12306/article/details/54564136
https://www.cnblogs.com/eastmount/p/5052871.html