使用conda安装库时出错,failed with initial frozen solve. Retrying with flexible solve

问题场景:

使用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

若要更详细了解,请访问以下朋友的解决方案。

stack overflow 对该问题的讨论
该通道找不到包的解决方案

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值