我刚刚在终端中运行了这个命令:
pip install --user --upgrade
它工作得很好,但是现在每当我尝试运行 pip 时,我都会收到这个:
$ pip --version
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 7, in <module>
from pip import main
ImportError: cannot import name 'main'
这些是我的 python 路径。
Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pprint import pprint as pp
>>> import sys
>>> pp(sys.path)
['',
'/usr/lib/python36.zip',
'/usr/lib/python3.6',
'/usr/lib/python3.6/lib-dynload',
'/home/smurf/.local/lib/python3.6/site-packages',
'/usr/local/lib/python3.6/dist-packages',
'/usr/local/lib/python3.6/dist-packages/setuptools-28.8.0-py3.6.egg',
'/usr/lib/python3/dist-packages',
'/usr/lib/python3.6/dist-packages']
我尝试重新安装 pip,但没有用。有人能解释一下这是怎么回事以及如何修复吗?
谢谢你,