ImportError: cannot import name 'main' after updating pip10

Several answers from Baidu did not solve the problem. Some of the answers were obviously copied directly and had no value at all, and then googled them immediately. Many times you can't blame the search engine. The problem lies in the irresponsible solution of knowledge by some domestic netizens: find the error file, which is the pip, then cd into the directory vi to edit the pip, and change the content to the following: # - *- 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())

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325195799&siteId=291194637