プロキシ環境下のLinux(WSL2 Ubuntu)で pip install
したら ProxyError
でうまく行かなかった話です。
エラー内容
例えばこのような内容です。
$ pip3 install pylint
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3e787ff340>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))': /simple/pylint/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3e787ff0d0>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))': /simple/pylint/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3e78806460>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))': /simple/pylint/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3e788065e0>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))': /simple/pylint/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f3e78806550>: Failed to establish a new connection: [Errno -5] No address associated with hostname'))': /simple/pylint/
ERROR: Could not find a version that satisfies the requirement pylint (from versions: none)
原因
環境変数を https_proxy=https://<略>
にしているのが悪かったようです。
https_proxy=http://<略>
にしたらうまく行きました。
あとがき
https_proxy
という名前からして https://
で書くのだと思っていましたが、違うのですね。
なぜダメなのかは、すみません、知識がなく分かりません…… お分かりの方がいればコメントいただけると幸いです。