WSL2上のAnacondaでプロキシも設定していない状態でCondaHTTPError
が発生した。
conda create -n test python=3.9
Collecting package metadata (current_repodata.json): failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/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.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
'https//repo.anaconda.com/pkgs/main/linux-64'
原因
.condarc
が消えていたみたい。
対応
conda info
で情報の確認
active environment : base
active env location : /home/hoge/anaconda3
shell level : 1
active environment : base
active env location : /home/katsuji/anaconda3
shell level : 1
user config file : /home/katsuji/.condarc #このファイルが消えていた
populated config files :
conda version : 22.9.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
populated config files :
conda version : 22.9.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
なにも書かずに.condarc
を該当dirに作成
touch .condarc
無事作成できました。proxyを設定している場合も同様なエラーが出るみたいなのでその際はproxyの設定を.condarc
に記載すればよい。