机器学习常用模块安装报错:conda安装sklearn库失败:

conda install sklearn 报错:`

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible so
lve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible so
lve.

PackagesNotFoundError: The following packages are not available from current cha
nnels:

  - sklearn

错误大概就是镜像中没有这个包
尝试这两种方法不可行
更换安装源为官方安装源conda config --add channels https://anaconda.org
设置灵活安装conda config --set channel_priority flexible

解决方法:
用pip安装 pip install sklearn

此时可能会报错,numpy版本不对应
尝试:conda install numpy==1.14.5 不可行
解决方法:
用pip安装 pip install numpy==1.14.5

注意:conda install 和pip install 互相搭配食用更好一点,一种不可用,换另一种往往就可以了。一定切记切记切记!!!

你可能感兴趣的:(Python)