Search code examples
pythonpipdnsconnectionpyinstaller

pip install {anything} is giving connection error?


WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001C2B0ECA710>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/ ............ WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x000001C2B0F562D0>: Failed to establish a new connection: [Errno 11002] getaddrinfo failed')': /simple/flask/ ERROR: Could not find a version that satisfies the requirement flask (from versions: none) ERROR: No matching distribution found for flask

I tried everything, First checking connection, changing to different network. Then i tried to reset the system setting to 2 days before, but it said that there is no change.(rtrui in win+r) Then i unistall my python & pip and redownloaded new Version and restart the PC, Still giving same error. Then Reset the Networks setting to how they were at begining of PC, still not solved. So i found out problem is not with my PC.

When i searched pypi.org in Chrome Browser its error "pypi.org’s DNS address could not be found. Diagnosing the problem. DNS_PROBE_POSSIBLE" So, There was a DNS problem because of which i was not able to access it, but my friend 40 km away is able to open this website.


Solution

  • The error is definitely a DNS "resolution problem" related to accessing the PyPI repository (pypi.org).

    I will try python3 -m pip install __ like omertairi suggested and " flushing your dns cache or switching from what I assume is your isp provided dns server" like JonSG suggested.

    You can also try to install python/access PyPI within a different PC on the 'Same Network'. This will tell you if the error is caused by the ips DNS or your Python installation. Or you can use your phone 'Data' to connect to PyPI through a different network.