问题场景:
使用conda安装第三方包时报错:
failed with initial frozen solve. Retrying with flexible solve
问题描述:
使用conda install scikit-learn 安装第三方包时出错。
(damon) C:\Users\LYYAO>conda install scikit-learn
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
原因分析:
1. 通道不对,该通道目前没有这个包PackagesNotFoundError: The following packages are not available from current channels:
- scikit-learn
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
解决方案:
改变通道的主要性conda config --set channel_priority flexible
2.conda 版本过高
(damon) C:\Users\LYYAO>conda --version
conda 4.8.5
解决方案:
降低conda的版本,前提是你的python版本是3.6, 3.7。如果不是也请将你的python版本降低conda config --set allow_conda_downgrades true
conda install conda=4.6.14
(damon) C:\Users\LYYAO>conda --version
conda 4.6.14
解决方案:
3.另外一种粗暴的解决办法
直接使用pip安装,可以成功安装第三方包,但后续可能会造成问题。
(damon) C:\Users\LYYAO>pip install scikit-learn
若要更详细了解,请访问以下朋友的解决方案。