2015-05-13 3 views
1

Вчера я попытался установить некоторые пакеты python с помощью pip, и это просто не сработает.pip не удается установить безопасное соединение с pypi-сервером

[email protected]:~$ pip install isort -v 
Downloading/unpacking isort 
    Could not fetch URL https://pypi.python.org/simple/isort/: connection error: [Errno 0] _ssl.c:344: error:00000000:lib(0):func(0):reason(0) 
    Will skip URL https://pypi.python.org/simple/isort/ when looking for download links for isort 
    Could not fetch URL https://pypi.python.org/simple/: connection error: [Errno 0] _ssl.c:344: error:00000000:lib(0):func(0):reason(0) 
    Will skip URL https://pypi.python.org/simple/ when looking for download links for isort 
    Cannot fetch index base URL https://pypi.python.org/simple/ 
    Could not fetch URL https://pypi.python.org/simple/isort/: connection error: [Errno 0] _ssl.c:344: error:00000000:lib(0):func(0):reason(0) 
    Will skip URL https://pypi.python.org/simple/isort/ when looking for download links for isort 
    Could not find any downloads that satisfy the requirement isort 
Cleaning up... 
    Removing temporary dir /tmp/pip_build_paquete... 
No distributions at all found for isort 
Exception information: 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1177, in prepare_files 
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade) 
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 277, in find_requirement 
    raise DistributionNotFound('No distributions at all found for %s' % req) 
DistributionNotFound: No distributions at all found for isort 

Storing debug log for failure in /tmp/tmpl86YQE 

Я искал ответ в Интернете без успеха. Многие ответы с 2012 года предлагают понизить рейтинг, но ошибка, которая была проблематичной, была исправлена ​​с тех пор.

[email protected]:~$ pip -V 
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7) 

У некоторых людей были проблемы с их интерпретатором python, но, похоже, он хорошо подключается к серверу.

[email protected]:~$ python 
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import httplib 
>>> conn = httplib.HTTPSConnection("pypi.python.org") 
>>> conn.request("GET","/simple/") 
>>> res = conn.getresponse() 
>>> print res.status, res.reason 
200 OK 

В качестве дополнительной информации, я сделал элементарную свежую установку несколько недель назад. Это происходит со всеми пакетами. Я установил все через apt, так что это кажется Любые идеи?

Обновление Следующее предложение от @andersson Я попытался установить последнюю версию pip. Затем это всплыло

[email protected]:~$ sudo python3 Downloads/get-pip.py -v 
The directory '/home/paquete/.cache/pip/log' or its parent directory is not owned by the current user and the debug log has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/home/paquete/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Starting new HTTPS connection (1): pypi.python.org 
There was an error checking the latest version of pip 
Traceback (most recent call last): 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 253, in ssl_wrap_socket 
    context.load_verify_locations(ca_certs) 
ssl.SSLError: unknown error (_ssl.c:2734) 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/adapters.py", line 370, in send 
    timeout=timeout 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 544, in urlopen 
    body=body, headers=headers) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 341, in _make_request 
    self._validate_conn(conn) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 762, in _validate_conn 
    conn.connect() 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/connection.py", line 238, in connect 
    ssl_version=resolved_ssl_version) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 255, in ssl_wrap_socket 
    raise SSLError(e) 
pip._vendor.requests.packages.urllib3.exceptions.SSLError: unknown error (_ssl.c:2734) 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last): 
    File "/tmp/tmp8w985p0e/pip.zip/pip/utils/outdated.py", line 126, in pip_version_check 
    headers={"Accept": "application/json"}, 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/sessions.py", line 476, in get 
    return self.request('GET', url, **kwargs) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/download.py", line 367, in request 
    return super(PipSession, self).request(method, url, *args, **kwargs) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/sessions.py", line 464, in request 
    resp = self.send(prep, **send_kwargs) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/sessions.py", line 576, in send 
    r = adapter.send(request, **kwargs) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/cachecontrol/adapter.py", line 46, in send 
    resp = super(CacheControlAdapter, self).send(request, **kw) 
    File "/tmp/tmp8w985p0e/pip.zip/pip/_vendor/requests/adapters.py", line 431, in send 
    raise SSLError(e, request=request) 
pip._vendor.requests.exceptions.SSLError: unknown error (_ssl.c:2734) 

Это, кажется, общая проблема.

+0

Чтобы добавить больше загадок, старый виртуальный пипс работает отлично. – elpaquete

ответ

0

У меня также есть проблемы с версией по умолчанию (1.5.4). Можете ли вы успешно обновить программу до последней версии (6.1.1), или вы уже пробовали и не удалось выполнить установку с обеих версий pip?

+0

Я немного рад, что это не только я. Следуя инструкциям https://pip.pypa.io/en/latest/installing.html, это произошло при запуске get-pip.py. /tmp/tmpRJjSJP/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:79: InsecurePlatformWarning: истинный объект SSLContext недоступен. Это не позволяет urllib3 правильно настроить SSL и может привести к сбою определенных SSL-соединений. Для получения дополнительной информации см. Https://urllib3.readthedocs.org/ru/latest/security.html#insecureplatformwarning. Я пойду в это. – elpaquete

+0

Я добавил дополнительную информацию к вопросу. – elpaquete

2

Моя проблема была несколько иной. Похоже, что в июне 2016 года был обновлен сертификат https://pypi.python.org/simple/, поэтому, если дата вашей ОС до этой даты, у вас возникнут проблемы с проверкой сертификата, независимо от того, установлены ли соответствующие сертификаты CA.

Смежные вопросы