ubuntu16 升级pip3后报错File "/usr/bin/pip3", line 9, in <module> from pip import main ImportError: cannot import name 'main'

问题:ubuntu16 执行pip3 install --upgrade pip之后,pip3执行出错。

Traceback (most recent call last):

File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'

截图如下:

 

问题解决方法:

sudo vi /usr/bin/pip3为下面的代码:

#!/usr/bin/python3
# GENERATED BY DEBIAN

import sys

# Run the main entry point, similarly to how setuptools does it, but because
# we didn't install the actual entry point from setup.py, don't use the
# pkg_resources API.
from pip import __main__
if __name__ == '__main__':
    sys.exit(__main__._main())

 

posted @ 2019-03-02 15:25  小毛熊  阅读(2015)  评论(0编辑  收藏  举报