ConnectTimeoutError installing Tensorflow on windows - proxy

I'm triying to install Tensorflow, and I get the following:
C:\>pip3 install --upgrade tensorflow
Collecting tensorflow
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by
ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x00000240DAD78BA8>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/tensorflow/
I've also tried to install it downloading the .whl on the GitHub repository, and I get the same kind of error:
C:\>pip3 install tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
Processing c:\tensorflow-1.1.0-cp35-cp35m-win_amd64.whl
Collecting bleach==1.5.0 (from tensorflow==1.1.0)
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000001FEE571BCC0>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/bleach/
My PC is connected to my university's network which need a HTTP proxy configuration. Could it be the problem? How could I fix it?

So pip work abruptly behind proxy for that you can refer Using pip behind a proxy
But for your alternate you can download Tensorflow wheel from (Python 2 CPU)
For other Python Version or CPU/GPU
https://github.com/tensorflow/tensorflow#installation

Related

Error: couldn't find version that satisfied requirements docutils==0.16 and no matching distribution found for docutils

While I was installing requirements.txt using: pip install -r requirements.txt.
I got this error
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/docutils/
ERROR: Could not find a version that satisfies the requirement docutils==0.16 (from versions: none)
ERROR: No matching distribution found for docutils==0.16
I tried downloading docutils alone using the command pip install docutils but it is still showing the same error. Please suggest some solutions.

Issue in pip install command

Please help me in fixing the below command
pip install GitPython
Error:
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifoedHTTPSConnection object at 0x00000>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',) ': /simple/gitpython
Could not find a version that satisfies the requirement GitPython (from versions :)
No matching distribution found for GitPython

how to install networkx package on CPython

I have installed CPython [1] on my local machine (macOS Catalina, v. 10.15.4) to speed up computations for function optimize_graph_edit_distance in networkx package. Before, I was running the code on Python3, which takes a lot of time. However, when I run the code with CPython (the alias for CPython is python3), I obtain the following error:
Traceback (most recent call last):
File "/Users/olha/Desktop/GED_optima.py", line 3, in <module>
import networkx as nx
ModuleNotFoundError: No module named 'networkx'
I tried python3 -m pip3 install networkx, but I got the following error:
Defaulting to user installation because normal site-packages is not writeable
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/networkx/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/networkx/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/networkx/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/networkx/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/networkx/
Could not fetch URL https://pypi.org/simple/networkx/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/networkx/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement networkx (from versions: none)
ERROR: No matching distribution found for networkx
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Does anybody knows how to install networkx on CPython?
Thank you!
Olha
[1]: https://github.com/python/cpython#documentation
You can install networkx by:
git clone https://github.com/networkx/networkx.git
cd networkx
sudo python setup.py install
Try running the following command (Copied from Mayur Deshmukh's answer to ssl not available):
python3 -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip

Pip Installation Problems EnvironmentError

I have no problems installing other dependencies but djangorestframework_simplejwt gives me the following error.
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))': /packages/3d/d7/92c717da4e3474fef8a5415391170eba60be16a4e531c9027c38b2c329c8/djangorestframework_simplejwt-3.2.3-py2.py3-none-any.whl
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/3d/d7/92c717da4e3474fef8a5415391170eba60be16a4e531c9027c38b2c329c8/djangorestframework_simplejwt-3.2.3-py2.py3-none-any.whl (Caused by ProtocolError('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer')))
EDIT
It seems to be a problem with my virtualenv. When I deactivate it then pip works fine.
WORKAROUND
So I found a workaround for the time being. I deactivated my env, then did pip install djangorestframework-simplejwt, then source bin/activate to activate my env. Then I would run pip install djangorestframework-simplejwt, it would use the cached version.

PIP not working - proxy

python pip is not working behind proxy
I tried
sudo -H pip --proxy https://proxy_ip:proxy_port install <package>
sudo -H pip --proxy https://usename:password#proxy_ip:proxy_port install <package>
sudo easy_install pip
and nothing is working, I also tried setting environment variables HTTP_PROXY but it isn't working.
For instance, here is the error when trying to install toolz:
Collecting toolz
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 407 Proxy Authentication Required',))': /simple/toolz/
Could not find a version that satisfies the requirement toolz (from versions: )
No matching distribution found for toolz
I use pip install behind a proxy frequently. Here's the syntax that's working for me:
sudo pip --proxy username:password#ip_address:port install <package_name>
The problem was within a conf file that loads old proxy settings. Also the environment variables are case sensitive. So check if there is a difference between HTTP_PROXY and http_proxy by using printenv in linux
Then as #MedAli suggested: adding --proxy while using pip will work

Resources