windows10环境下在annaconda环境中出现pandas和 scikit-learn导包错误ImportError解决方案

annaconda环境下运行机器学习是发现pandas和sklearn发生导包错误,具体如下:

bug1

ImportError: C extension: No module named 'pandas._libs.tslib' not built. If you want to import pand

关键词:

bug2

ImportError: No module named 'sklearn.__check_build._check_build'
___________________________________________________________________________
Contents of C:\Anaconda3\lib\site-packages\sklearn\__check_build:
setup.py                  _check_build.cp37-win_amd64.pyd__init__.py
__pycache__
___________________________________________________________________________
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.

关键词: ImportError, pandas._libs.tslib,

解决方案流程

在终端环境中按照如下步骤操作:

conda list

  • 1 查看annaconda环境下的安装包,找到pandas和scikit-learn,如果没有相关的2个包,请安装
  • 2 如果安装后出现这种问题,直接更新这两个包

conda update scikit-learn

  • 3 如下图所示
    windows10环境下在annaconda环境中出现pandas和 scikit-learn导包错误ImportError解决方案
  • 4 出现Proceed ([y]/n)?直接输入y,就可以等待安装好就可以使用,如果不可以,直接重启软件,就可以

解决方案关键点

终端代码

conda list  # 查看已经安装的包
conda update scikit-learn  #更新机器学习软件
conda update pandas  # 更新pandas软件

以上内容仅是代表个人总结 若有错误之处,还请批评指正,欢迎大家一起学习!