Сломался pip, возможно после очередного обновления пакетов.
root@host:/usr/local/bin# pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==7.1.0', 'console_scripts', 'pip')()
File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 558, in load_entry_point
File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 2682, in load_entry_point
File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 2355, in load
File "/usr/local/lib/python3.4/dist-packages/setuptools-18.1-py3.4.egg/pkg_resources/__init__.py", line 2361, in resolve
ImportError: No module named 'pip'
root@host:/usr/local/bin# which pip
/usr/local/bin/pip
root@host:/usr/local/bin# python -V
Python 2.7.6
root@host:/usr/local/bin# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin*
Была также установленная через apt-get версия, удалил её, проблема осталась.
Пробовал установить:
curl https://bootstrap.pypa.io/get-pip.py | sudo python
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1488k 100 1488k 0 0 1184k 0 0:00:01 0:00:01 --:--:-- 1184k
The directory '/home/n.volynkin/.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.
The directory '/home/n.volynkin/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/tmp/tmptqUbcI/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
/tmp/tmptqUbcI/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
directory '/home/n.volynkin/.cache/pip/http' or its parent directory is not owned by the current user
Проверил, все принадлежат мне.
Про SNI вообще не понимаю, в чём ошибка.
Вопрос: как починить установку или хотя бы как целиком удалить уже установленный (и сломанный) pip? Откуда вообще взялся pip в /usr/local/bin/pip?
#!/usr/bin/python3.4
curl https://bootstrap.pypa.io/get-pip.py | sudo python3.4