base CUserslenovoconda config --show-sources== CUserslenovocondarc ==channels - httpsmirrorstunatsinghuaeducnanacondapkgsmain - httpsmirrorstunatsinghuaeducnanacondapkgsfree - httpsmirrorsaliyuncom
根据以上命令输出信息,发现添加的 pypi/simple 频道无法访问,因此需要更改 conda 配置,将无法访问的频道删除,或更换为可访问的频道。下面是具体步骤:
-
查看当前 conda 配置中的频道信息:
conda config --show channels输出信息类似于:
channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/ - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ - https://mirrors.aliyun.com/pypi/simple/ - https://pypi.tuna.tsinghua.edu.cn/simple - defaults -
删除无法访问的频道:
conda config --remove channels pypi/simple如果要删除多个频道,可以在命令中重复使用
--remove参数。 -
添加可访问的频道:
conda config --add channels conda-forge这里以添加 conda-forge 频道为例,如果要添加其他频道,可以将
conda-forge替换为其他名称。 -
重新创建虚拟环境:
conda create -n pytorch python=3.10如果创建成功,则说明问题已经解决。如果仍然无法创建虚拟环境,可能是由于其他原因导致,可以尝试更改其他配置项,或者查看错误信息,进一步排查问题
原文地址: https://www.cveoy.top/t/topic/cr4U 著作权归作者所有。请勿转载和采集!