在通過vscode向服務器安裝pytorch時,切換了清華源之后,遇到了下面的錯誤:
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.
遇到此錯誤的時添加的清華源如下:
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
解決方案:
將添加的清華源地址中的https改為http,添加清華源如下:文章來源:http://www.zghlxwxcb.cn/news/detail-649999.html
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
改為http后再運行pytorch安裝命令就不會出現(xiàn)上面所提到的錯誤,如下圖所示:
附:
清空源命令:文章來源地址http://www.zghlxwxcb.cn/news/detail-649999.html
conda config --remove-key channels
到了這里,關于An HTTP error occurred when trying to retrieve this URL.(解決方案)的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!