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,問題終於解決了!!!!

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