求助:使用conda安装Python 3.9失败,报PackagesNotFoundError错误
解决conda无法安装Python 3.9的问题
执行conda create --name demo-env python=3.9时,删除同名环境后出现如下错误:
Collecting package metadata: / Unable to retrieve repodata (404 error) for https://repo.anaconda.com/pkgs/main/noardone Solving environment: failed PackagesNotFoundError: The following packages are not available from current channels: - python=3.9 Current channels: - https://repo.anaconda.com/pkgs/main/linux-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/free/linux-64 - https://repo.anaconda.com/pkgs/free/noarch - https://repo.anaconda.com/pkgs/r/linux-64 - https://repo.anaconda.com/pkgs/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.
问题原因
- 通道地址拼写错误:错误信息里的
noardone是noarch的拼写失误,导致元数据检索返回404 - 默认conda通道未同步Python 3.9包,或本地缓存过期
解决方案
修复错误通道
先查看当前配置的通道列表:conda config --show channels如果存在
https://repo.anaconda.com/pkgs/main/noardone这条错误通道,执行命令删除:conda config --remove channels https://repo.anaconda.com/pkgs/main/noardone清理缓存并更新conda
清理本地缓存的包和元数据:conda clean --all更新conda到最新版本:
conda update conda添加conda-forge通道
若默认通道仍找不到Python 3.9,添加社区维护的conda-forge通道:conda config --add channels conda-forge重新创建环境:
conda create --name demo-env python=3.9也可在创建时直接指定通道:
conda create --name demo-env python=3.9 -c conda-forge验证Python版本可用性
查询当前通道中是否存在Python 3.9的包:conda search python=3.9若无结果,确认系统架构是否支持(比如32位系统可能无对应包),但linux-64架构下Python 3.9是存在的,大概率是通道配置或缓存问题。
内容的提问来源于stack exchange,提问作者Exploring
相关产品推荐
相关产品推荐

