Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip: Caused by ResponseError('too many 500 error responses')

Tags:

python

pip

I'm trying install packages through pip, but every package I try to install, it fails with

ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy

When running the same command with -vvv like pip install numpy -vvv it gives the following output.

Using pip 20.2.1 from c:\program files\python38\lib\site-packages\pip (python 3.8)
Defaulting to user installation because normal site-packages is not writeable
Created temporary directory: C:\Users\d\AppData\Local\Temp\pip-ephem-wheel-cache-bo4luxtk
Created temporary directory: C:\Users\d\AppData\Local\Temp\pip-req-tracker-8z32xx1a
Initialized build tracking at C:\Users\d\AppData\Local\Temp\pip-req-tracker-8z32xx1a
Created build tracker: C:\Users\d\AppData\Local\Temp\pip-req-tracker-8z32xx1a
Entered build tracker: C:\Users\d\AppData\Local\Temp\pip-req-tracker-8z32xx1a
Created temporary directory: C:\Users\d\AppData\Local\Temp\pip-install-2se6s0ld
1 location(s) to search for versions of numpy:
* https://pypi.org/simple/numpy/
Fetching project page and analyzing links: https://pypi.org/simple/numpy/
Getting page https://pypi.org/simple/numpy/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/numpy/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 500 655
Incremented Retry for (url='/simple/numpy/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
Retry: /simple/numpy/
Resetting dropped connection: pypi.org
Starting new HTTPS connection (2): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 500 655
Incremented Retry for (url='/simple/numpy/'): Retry(total=3, connect=None, read=None, redirect=None, status=None)
Retry: /simple/numpy/
Resetting dropped connection: pypi.org
Starting new HTTPS connection (3): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 500 655
Incremented Retry for (url='/simple/numpy/'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
Retry: /simple/numpy/
Resetting dropped connection: pypi.org
Starting new HTTPS connection (4): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 500 655
Incremented Retry for (url='/simple/numpy/'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
Retry: /simple/numpy/
Resetting dropped connection: pypi.org
Starting new HTTPS connection (5): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 500 655
Incremented Retry for (url='/simple/numpy/'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
Retry: /simple/numpy/
Resetting dropped connection: pypi.org
Starting new HTTPS connection (6): pypi.org:443
https://pypi.org:443 "GET /simple/numpy/ HTTP/1.1" 500 655
Could not fetch URL https://pypi.org/simple/numpy/: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by ResponseError('too many 500 error responses')) - skipping
Given no hashes to check 0 links for project 'numpy': discarding no candidates
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy
Exception information:
Traceback (most recent call last):
  File "c:\program files\python38\lib\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
    status = self.run(options, args)
  File "c:\program files\python38\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "c:\program files\python38\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
    requirement_set = resolver.resolve(
  File "c:\program files\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "c:\program files\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\program files\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 339, in _get_abstract_dist_for
    self._populate_link(req)
  File "c:\program files\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 305, in _populate_link
    req.link = self._find_requirement_link(req)
  File "c:\program files\python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 270, in _find_requirement_link
    best_candidate = self.finder.find_requirement(req, upgrade)
  File "c:\program files\python38\lib\site-packages\pip\_internal\index\package_finder.py", line 926, in find_requirement
    raise DistributionNotFound(
pip._internal.exceptions.DistributionNotFound: No matching distribution found for numpy
1 location(s) to search for versions of pip:
* https://pypi.org/simple/pip/
Fetching project page and analyzing links: https://pypi.org/simple/pip/
Getting page https://pypi.org/simple/pip/
Found index url https://pypi.org/simple
Looking up "https://pypi.org/simple/pip/" in the cache
Request header has "max_age" as 0, cache bypassed
Starting new HTTPS connection (1): pypi.org:443
https://pypi.org:443 "GET /simple/pip/ HTTP/1.1" 500 655
Could not fetch URL https://pypi.org/simple/pip/: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by ResponseError('too many 500 error responses')) - skipping
Given no hashes to check 0 links for project 'pip': discarding no candidates
Removed build tracker: 'C:\\Users\\d\\AppData\\Local\\Temp\\pip-req-tracker-8z32xx1a'

My pip.ini file looks like

[global]
trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org

How can the 'too many 500 error responses' mentioned in the error be fixed?

Edit:

Reinstalling Python has not fixed the issue and I am using Python 3.8.6. I've also tried restarting my computer.

like image 557
Dan Avatar asked Nov 22 '25 07:11

Dan


1 Answers

In my case this seems to be a combination of Proxy Server and on one occasion, using a requirements.txt that had been created by pip freeze from another computer and package version numbers were not compatible with my environment. With the latter problem, it was easy, just remove the version numbers and allow Python to grab a compatible version.

the proxy errors for me seem to be intermittent. I can get pip to work most times, but always from my Red Hat Server with the correct proxy settings in http_proxy and https_proxy environment variables. When i try to run pip when building a Docker Container, again with the correct environment variables set in the Dockerfile, I normally can not get a connection and then all of a sudden it works fine.

In summary, this is likely not a problem with pypi.org or files.pythonhosted.org, but probably proxy server settings or trying to install a package that is not compatible with your environment.

like image 136
PrestonDocks Avatar answered Nov 24 '25 20:11

PrestonDocks



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!