欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

anaconda的scikit-learn报错It seems that scikit-learn has not been built

程序员文章站 2022-05-17 23:33:55
我们在导入sklearn时往往会报错。 折腾了一下午之后的解决方案:1.**,解决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.*fq,解决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