pip Import Error:cannot import name main解决

pip升级后出现pip Import Error:cannot import name main报错

原内容

1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/python
# 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())

修改后内容

1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/python
# 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())
sys.exit(__main__._main())
坚持原创技术分享,您的支持将鼓励我继续创作!