After pip 10 upgrade on pyenv “ImportError: cannot import name ‘main'”

After pip 10 upgrade on pyenv “ImportError: cannot import name ‘main'”

亲测有效:https://github.com/pypa/pip/issues/5240

replace the contents of /use/bin/pip file with the following code.

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

from pip._internal import main as _main

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

.

发表评论

电子邮件地址不会被公开。 必填项已用*标注