1. 問題描述:
pycharm安裝第三方庫時提示CondaHTTPError: HTTP 000 CONNECTION FAILED。
2. 錯誤原因:默認鏡像源訪問速度過慢,會導致超時從而導致更新和下載失敗。
3. 解決方案:更換鏡像源為清華鏡像源,並且刪除默認鏡像源。
3.1.首先執行如下幾條命令更換清華鏡像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
注:在cmd中一次輸入以上命令
3.2.更改鏡像源配置文件
在用戶根目錄(C:\Users\用戶名)下找到.condarc文件,打開並並編輯,刪除其中的default配置行。
4.重新創建虛擬環境,成功!
原文地址:https://cloud.tencent.com/developer/article/1572996