操作步骤
root@AW:/home/DNCT# pip install --upgrade pip
结果现象:
root@AW:/home/DNCT# pip -V
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
from pip import main
ImportError: cannot import name main
造成原因:
pip升级后模块调用改变
结局方法:
root@AW:/home/DNCT# vim /usr/bin/pip
#!/usr/bin/python
# GENERATED BY DEBIAN
import sys
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())