近使用conda安裝包錯誤倾哺,一直報(bào)連不上網(wǎng),后來查看一下原因。是因?yàn)榍迦A鏡像改了岩臣,塞了個文件夾(修改.condarc文件这吻,在后面加上平臺名如lunix-64/曲管,win-64/)。這不是往用戶這添堵么癞松,往用戶嘴里塞蒼蠅啊。
錯誤:
(base) jack@omnisky:~/biosoft$ conda install samtools
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/linux-64/current_repodata.json>
Elapsed: -
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.
'https://conda.anaconda.org/conda-forge/linux-64'
解決方案:
原因:使用默認(rèn)鏡像源或配置出錯入蛆,使鏡像源訪問速度過慢响蓉,會導(dǎo)致超時從而導(dǎo)致更新和下載失敗。
修改.condarc文件: vi ~/.condarc
原來的.condarc文件
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- conda-forge //這兩個就是亂入了哨毁,可能是之前添加鏡像出錯的
- bioconda
show_channel_urls: true
ssl_verify: false //這個是當(dāng)初找解決方案的嘗試枫甲,不過沒有效果
修改后的.condarc文件:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/lunix-64/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/lunix-64/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/lunix-64/
show_channel_urls: true