问题: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 DEBIANimport 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())