Failed to install Python libraries

I cannot install any Python libraries. I use pip 9.0.1and python 2.7. I get the following error:

EN-NishantS:~ 8417$ pip install presto-python-client
Collecting presto-python-client
  Could not find a version that satisfies the requirement presto-python-client (from versions: )
No matching distribution found for presto-python-client

When I start with, pip install -vvvI get the following:

Collecting presto-python-client
  1 location(s) to search for versions of presto-python-client:
  * https://pypi.python.org/simple/presto-python-client/
  Getting page https://pypi.python.org/simple/presto-python-client/
  Looking up "https://pypi.python.org/simple/presto-python-client/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pypi.python.org
  "GET /simple/presto-python-client/ HTTP/1.1" 403 170
  Status code 403 not in [200, 203, 300, 301]
  Could not fetch URL https://pypi.python.org/simple/presto-python-client/: 403 Client Error: TLSv1.2+ is required for url: https://pypi.python.org/simple/presto-python-client/ - skipping
  Could not find a version that satisfies the requirement presto-python-client (from versions: )
Cleaning up...
No matching distribution found for presto-python-client
Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/index.py", line 514, in find_requirement
    'No matching distribution found for %s' % req
DistributionNotFound: No matching distribution found for presto-python-client
Looking up "https://pypi.python.org/pypi/pip/json" in the cache
No cache entry available
Starting new HTTPS connection (1): pypi.python.org
"GET /pypi/pip/json HTTP/1.1" 403 170
Status code 403 not in [200, 203, 300, 301]
There was an error checking the latest version of pip
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/outdated.py", line 128, in pip_version_check
    resp.raise_for_status()
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/models.py", line 862, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
HTTPError: 403 Client Error: TLSv1.2+ is required for url: https://pypi.python.org/pypi/pip/json
+12
source share
7 answers

On mac you can do sudo curl https://bootstrap.pypa.io/get-pip.py | python

+9
source

Today I faced the same problem trying to install Django.

I just reinstalled the pip. Get get-pip.py from https://pip.pypa.io/en/stable/installing/ and just run python get-pip.pyin your python get-pip.pydirectory. This should overwrite the existing installation and renew the SSL certificate.

+6
source

macOS v10.12 (Sierra) , brew install python@2 . , Python OpenSSL.

, - Python: OS X OpenSSL - libssl

+4

HTTP- PyPI HTTP 403 (Forbidden):

HTTPError: 403 Client Error: TLSv1.2+ is required for url:

https://pypi.python.org/pypi/pip/json

-, pip PyPI HTTPS ( ), () SSL. , , . , .

Debian :

apt-get update && apt-get upgrade python-pip

Red Hat Linux:

yum update python-pip # (or python2-pip, at least on Red Hat Linux 7)

Mac:

sudo easy_install -U pip

openssl .

+3

, , pip install package-name. :

, .

, pip pip install --upgrade pip ( , ).

( Mac, ), :

curl https://bootstrap.pypa.io/get-pip.py | python

:

Python.org TLS 1.0 1.1. , Mac OS X 10.12 (Sierra) pip, , .

( Twitter):

Mac, pip PyPI:

macOS/OS X 10.12 , (9.0.3), Python:

curl https://bootstrap.pypa.io/get-pip.py | python

8 .

Pip 9.0.3 TLSv1.2 Python macOS <10.13. : https://pip.pypa.io/en/stable/news/

, Python:

- , TLSv1.0 TLSv1.1 . 11, 15:37 UTC

. , TLSv1.0 TLSv1.1 HTTP 403 . 8 , 15:49 UTC

, , , setuptools :

pip install --upgrade setuptools
+3

Python 3 macOS v10.13 (High Sierra), sudo pip3 install --upgrade pip.

To upgrade the version of High Sierra 2.7 I had to use sudo pip2 install --upgrade pip.

+2
source

I had a similar problem.

The problem was with the old version of OpenSSL related to installing the Python system.

So I uninstalled all Python distributions from the system and installed the latest Python implementation using brew install python@2.

You can check the version of OpenSSL associated with Python as follows:

Python 2.7.14 (default, Mar 22 2018, 15:04:47)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2o  27 Mar 2018'
+1
source

Source: https://habr.com/ru/post/1696007/


All Articles