from pip._internal import main报错">

File "/usr/local/bin/pip3", line 6, in from pip._internal import main报错

集成gitlab ci时虚拟环境安装依赖时pip3报错记录一下

image.png

解决办法(编辑/usr/local/bin/pip3文件):

sudo vim /usr/local/bin/pip3
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import re
import sys

from pip._internal.cli.main import main

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

改为

#!/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())

你可能感兴趣的:(File "/usr/local/bin/pip3", line 6, in from pip._internal import main报错)