Traceback (most recent call last): File "./pip", line 9, in from pip import main

在Ubuntu18.04上使用pip命令,突然报出这样一个错误

wong@wong:/usr/bin$ pip
Traceback (most recent call last):
  File "./pip", line 9, in <module>
    from pip import main
ImportError: cannot import name 'main'

解决办法:
打开/usr/bin/pip

wong@wong:/usr/bin$ sudo vim /usr/bin/pip

from pip import main

换成

from pip._internal import main

问题解决!

你可能感兴趣的:(python,pip)