import sys
from pip import main
if __name__ == '__main__':
sys.exit(main())
sudo vim /usr/bin/pip3 #将上面代码改为如下
import sys
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
Ref: 1.stackoverflow
知易行难
import sys
from pip import main
if __name__ == '__main__':
sys.exit(main())
import sys
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
Ref: 1.stackoverflow