问题描述:
使用conda install XXX安装第三方包时出错。
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.
原因分析:通道不对,该通道目前没有这个包
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- activate
Current channels:
- https://conda.anaconda.org/conda-forge/linux-64
- https://conda.anaconda.org/conda-forge/noarch
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/linux-64
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
- https://conda.anaconda.org/bioconda/linux-64
- https://conda.anaconda.org/bioconda/noarch
- https://repo.anaconda.com/pkgs/main/linux-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/linux-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://conda.anaconda.org/r/linux-64
- https://conda.anaconda.org/r/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
解决方案二:设置channel_priority 为false
conda config --set channel_priority false
解决方案三:conda版本问题
1、更新conda环境
# 查看版本
conda -V
# 更新conda环境
conda update -n base conda
# 更新conda的所有包
conda update --all
#修改频道
conda config --add channels conda-forge
conda config --set channel_priority flexible
2、降低conda版本
conda config --set allow_conda_downgrades true
conda install conda=4.6.14 #要重启另一个窗口查看
conda -V
解决方案四:
把miniconda卸载,重新安装,更换版本为miniconda3 4.6.14版本。
我尽力了,把网上的方法总结在此。
参考文章:
https://blog.csdn.net/Sakura_Logic/article/details/108312146
https://blog.csdn.net/tiaochewang219/article/details/108061728
https://blog.csdn.net/LiiXuanYue/article/details/108808260
https://www.jianshu.com/p/4c7b9127cf83