pip指向问题:python2 or python3 ?

which pip查看pip路径,比如:/usr/local/bin/pip

sudo gedit /usr/local/bin/pip打开文件文件,并进行修改

#!/usr/bin/python3

# -*- coding: utf-8 -*-
import re
import sys

from pip import main

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(main())

将第一行 #!/usr/bin/python3 修改为

#!/usr/bin/python2

然后pip 就指向python2

你可能感兴趣的:(Ubuntu)