问题
使用pip install 出现以下错误信息:
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
^
SyntaxError: invalid syntax
解决
# 1, 从官方github获取具体版本的pip
wget https://raw.githubusercontent.com/pypa/get-pip/master/2.6/get-pip.py
# 2,运行刚才获取的pip文件
python2.6 get-pip.py
测试
pip -V
pip 9.0.3 from /usr/lib/python2.6/site-packages (python 2.6)