错误提示
➜ ~ pipTraceback (most recent call last): File "/usr/bin/pip", line 11, inload_entry_point('pip==10.0.1', 'console_scripts', 'pip')() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 476, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2700, in load_entry_point return ep.load() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2318, in load return self.resolve() File "/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "/usr/lib/python3.6/site-packages/pip/_internal/__init__.py", line 42, in from pip._internal import cmdoptions File "/usr/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in from pip._internal.index import ( File "/usr/lib/python3.6/site-packages/pip/_internal/index.py", line 20, in from pip._vendor.requests.exceptions import SSLErrorModuleNotFoundError: No module named 'pip._vendor.requests.exceptions'
问题分析
系统是Manjaro Linux,pip是通过包管理器pacman安装的,这个应该是包管理器安装的pip出现了问题。
卸载试试。看看能不能在安装后换回包管理器版本的pip,因为这样子系统很干净。解决方案
- 卸载pip
sudo pacman -R python-pip
- 下载最新的pip源码包当前为10.0.1,
wget https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz
- 解压
tar -zxvf pip-10.0.1.tar.gz && cd pip-10.0.1
- 安装pip
sudo python3 setup.py install
- 安装pip完成 如果你没有系统洁癖,强迫症到这里就完成了。 这样子安装的pip无法通过包管理器完成更新,每次需要手动更新。
- 卸载pip
sudo python -m pip uninstall pip
- 重新安装pip
sudo pacman -S python-pip