pip in virtualenv gets ConnectTimeoutError

2019-07-17 04:45发布

问题:

I'm current attempting to install packages in a python-3.4 virtualenv and I keep getting these Retry/TimeoutErrors.

(backend)root@XXXX:/var/virtualenvs# pip3 install -r backend-freeze.txt
Collecting cassandra-driver==2.7.2 (from -r backend-freeze.txt (line 1))
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4d7faf94a8>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/cassandra-driver/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4d7faf9588>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/cassandra-driver/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4d7faf9668>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/cassandra-driver/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f4d7faf9748>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/cassandra-driver/

Not sure what's going on here. I'm not using a proxy (which seems to be the case for others who have stated their experience with similar/same error).

回答1:

So, I discovered the issue. I'm not sure how this happened, but someone put a DROP all anywhere/anywhere iptables line in the INPUT chain.

I promise it wasn't me, but removing that line definitely resolved the issue. Now to figure out which employee thought that'd be a great idea.