Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
162 views
in Technique[技术] by (71.8m points)

python - Proxy Error with Pip3.8 while curl is working

I have both the env variables set : http_proxy and http_proxy Its working fine. Also, it doesnt need authentication.

The trouble is using proxy with pip3.8. I am using this mirror: https://pypi.tuna.tsinghua.edu.cn/simple And the following command:

pip3.8 install -i https://pypi.tuna.tsinghua.edu.cn/simple pycparser --proxy https://<>:<>

Output:
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/pycparser/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/pycparser/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/pycparser/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/pycparser/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/pycparser/
ERROR: Could not find a version that satisfies the requirement pycparser==2.19
ERROR: No matching distribution found for pycparser==2.19

Also, doing a basic curl on the mirror works:

$ curl -sL   https://pypi.tuna.tsinghua.edu.cn/simple > curl.txt
$ cat curl.txt | tail -n10

    <a href="zzu-low2/">zzu-low2</a><br/>
    <a href="zzyzx/">zzyzx</a><br/>
    <a href="zzz/">zzz</a><br/>
    <a href="zzzeeksphinx/">zzzeeksphinx</a><br/>
    <a href="zzzfs/">zzzfs</a><br/>
    <a href="zzzutils/">zzzutils</a><br/>
    <a href="zzzz/">zzzz</a><br/>
    <a href="zzzzls-spider/">zzzzls-spider</a><br/>
  </body>

As a part of troubleshooting, I unset the env variable to use the proxy only with pip command but that also didnt work. Pls help

More info on pip in use: pip 21.0.1 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)

question from:https://stackoverflow.com/questions/66048379/proxy-error-with-pip3-8-while-curl-is-working

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...