简体   繁体   中英

SSL Issue while installing any package using pip behind the proxy

Facing issues while installing tensorflow or any other package behind the proxy :

First try :

Run the command :

pip install --upgrade tensorflow

Output :

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was
 forcibly closed by the remote host', None, 10054, None))': /simple/tensorflow/

Second try :

Then I provided the proxy details along with the command

>pip install --upgrade tensorflow --proxy http://user:passwd@xxx.xx.x.xx:80

Output error :

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:83
3)'),)': /simple/tensorflow/

Third try as suggested on pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)" :

pip install --upgrade tensorflow --trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy http://user:passwd@xxx.xx.x.xx:80

Output :

Same as above.

Can anyone help ??

edit : working on windows machine

I would suspect that you might need to set your proxy environment variables on your machine to use your proxy. Try setting the following (assumming your on a Linux or Mac OS):

export HTTP_PROXY=http://user:passwd@xxx.xx.x.xx:80
export HTTPS_PROXY=https://user:passwd@xxx.xx.x.xx:443

You don't necessarily need to set the HTTPS_PROXY variable but it can't hurt to do so

Then try running without the flags

pip install tensorflow

I had a similar issue after some update mix-ups between pip and apt. Following the suggestions on some SO page that I don't recall I've launched

sudo python -m easy_install --upgrade pyOpenSSL 

and got the things running again.

LE: might've misread the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM