I
I
Ilya2017-11-09 06:59:13
linux
Ilya, 2017-11-09 06:59:13

Why can't python download packages?

I run the installation sudo python setup.py install
In the process, the following lines appear:

Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for stratum>=0.2.15
error: Could not find suitable distribution for Requirement.parse('stratum>=0.2.15')

There are suspicions that the error is due to http and not https , but how to fix it?
Internet connection is normal.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex Bunin, 2017-11-09
@azxc

This is to be expected, since pypi recently disabled http support and all requests should now go to https://pypi.python.org. You most likely have the old setuptools library installed. I advise you to update it pip install -U setuptools(if you have Linux, it is better to use the built-in package manager (yum, apt-get, apk, etc.) to install a more recent version of setuptools). Better yet, install pip and install the package with pip install -U name. In the latest (2.7.9+, 3.4x+) you can say python -mensurepip, which will install more or less modern versions of setuptools and pip.

P
Pavel Gruznykh, 2017-11-09
@pavelcarcass

Your suspicion is most likely correct, since wget complains when downloading this URL:

--2017-11-09 12:30:39--  http://pypi.python.org/simple/
Resolving pypi.python.org (pypi.python.org)... 151.101.36.223
Connecting to pypi.python.org (pypi.python.org)|151.101.36.223|:80... connected.
HTTP request sent, awaiting response... 403 SSL is required
2017-11-09 12:30:39 ERROR 403: SSL is required.

Open the setup.py file in a text editor, find the reference to this address and change the http address to https.

V
Vasily Shakhunov, 2017-12-20
@inf

Googled this error and came across here. The correct answer is here .
Too lazy to reap: Update distribute_setup.py

50 DEFAULT_URL = "https://pypi.python.org/packages/source/d/distribute/"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question