anaconda下载多个Python版本的坑[换源/condaerror: cannot link a source that does not exist]

在开始中打开anaconda的命令行
在这里插入图片描述
首先第一步是检测你的网络是否通畅的!也就是你的镜像链接可不可以用!
conda update conda
然后发现连不上,此时就要更换镜像源了!
最简单的方式是:
conda config --set show_channel_urls yes先在C:\Users\你的用户名下生成.condarc文件,然后找到它,用记事本打开。
在这里插入图片描述
然后输入以下内容,注意这里的源是可能过期的,一旦有一个过期了可能导致全部不能用,所以不要加入太多的源,以及记得把默认的default删掉!!

channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - conda-forge
show_channel_urls: true
channel_alias: https://mirrors.tuna.tsinghua.edu.cn/anaconda
default_channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
  conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
  simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
ssl_verify: true

接下来尝试conda create -n myenv numpy是否成功,但是发现然后依旧报错:
An HTTP error occurred when trying to retrieve this URL. HTTP errors are often intermittent, and a simple retry will get you on your way. ConnectionError(ReadTimeoutError("HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443):
这是因为开了s开头某代理软件,关上之后终于成功。
接下来就是要创造Python3.7的虚拟环境了。每个虚拟环境可以是不同的Python版本。
conda create -n py37 python=3.7 anaconda
然后遇到了一个这样的问题:
CondaError: Cannot link a source that does not exist. D:\anaconda3\Scripts\conda.exe
此时先conda clean --all --yes
然后的问题是UnsatisfiableError: The following specifications were found to be in conflict:
在这里插入图片描述
当我再次使用conda update conda的时候,我又遇到了上面的一个问题。仔细一看问题应该是前一句而不是后一句ERROR conda.core.link:_execute_actions(335): An error occurred while installing package 'defaults::tqdm-4.46.0-py_0'.
那我就重新安装一下这个tqdmconda install tqdm -f,问题终于解决了!!!!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章