問題:ubuntu16 執行pip3 install --upgrade pip之後,pip3執行出錯。 Traceback (most recent call last): File "/usr/bin/pip3", line 9, in <module> from pip import 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())