>
目錄
- 背景
- 1: 創建環境時出現ProxyError
- 解決方案
- 2:安裝依賴時出現ProxyError
- 解決方案:
背景
ProxyError: Conda cannot proceed due to an error in your proxy configuration.
使用的是組里的服務器,主要是在創建虛擬環境以及在已創建的虛擬環境中使用運行時都出現了同樣的ProxyError,主要是因為conda沒法處理代理,因此得要用戶手動修改**.condarc**文件。一共分為兩步
ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy configuration settings.
1: 創建環境時出現ProxyError
~$ conda create -n nn Collecting package metadata (current_repodata.json): failed
ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy
configuration settings.
解決方案
首先進入**.condarc**文件,通常為空
~$ vim .condarc
這里對**.condarc**的修改如下:
channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r - 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 pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
之后conda可以創建虛擬環境,本以為一切ok準備安裝一些依賴包的時候,ProxyError再次出現。
2:安裝依賴時出現ProxyError
安裝pytorch時錯誤再次出現
~$ conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch Collecting package metadata (current_repodata.json): failed
ProxyError: Conda cannot proceed due to an error in your proxy configuration.
Check for typos and other configuration errors in any '.netrc' file in your home directory,
any environment variables ending in '_PROXY', and any other system-wide proxy
configuration settings.
解決方案:
同樣是對**.condarc**文件進行修改,首先查看自己的代理ip
~$ echo $http_proxy http://...
復制打印出的代理ip地址并添加到**.condarc**配置文件中。(地址都是http,不是https)
proxy_servers: http: http://... https: http://... ssl_verify: False
以上就是服務器安裝conda環境遇到代理PROXY問題及解決方案的詳細內容,更多關于服務器安裝conda PROXY的資料請關注其它相關文章!
>