LoginSignup
2
2

More than 3 years have passed since last update.

condaコマンドでHTTPエラーが出た

Last updated at Posted at 2020-10-23

Ubuntu18.04.5

いざconda環境を作ろう!(conda create -n 環境名)という段階でエラー↓

>> conda create -n test
Collecting package metadata (current_repodata.json): done
Solving environment: done

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'

解決法

1.condaのバージョンが古い?

conda update anaconda-navigator

(参考元: https://mugichoko.hatenablog.com/entry/2020/01/13/061539)

解決しない。違うな。

2.SSLの設定が違う?

conda config --set ssl_verify no

(参照元: ​​​​​​​​https://qiita.com/takenawa/items/764682c47a0361dd773f)

これも違うな。そもそも以前はこんな設定してなくても使えてたしな。

3.プロキシ設定が違う?

proxy_servers:
  http: http://プロキシアドレス:ポート番号
  https: http://プロキシアドレス:ポート番号
ssl_verify: true

(参照元: https://qiita.com/kitakrazy/items/af6c0fea17adef514ba8)

これを$homeで .condarc として作成すると見事解決。

Ubuntuとコマンドプロンプトとcondaは全て別々のプロキシ設定になっているらしい
(研究室のサーバ使ってるからだと思うんだけど)

一応、後の自分が困らない用にそれもメモすると、
Ubuntu:
設定>ネットワーク>ネットワークプロキシ>手動
HTTPプロキシとHTTPSプロキシに、プロキシアドレスとポート番号を入力

コマンドプロンプト:

sudo vi /etc/apt/apt.conf.d/80proxy

ってファイル作って

Acquire::http::proxy "http://ポートアドレス:ポート番号";
Acquire::https::proxy "http://ポートアドレス:ポート番号";

を書き込む。

そしてcondaのプロキシ設定はさっきのやつ。
ただし、研究室以外でネットワークに接続する際は、これらを全てでコメントアウトしなければいけない。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2