报错内容如下:
Traceback (most recent call last):
File "/var/app_data/miniconda/envs/ddei/bin/pip", line 7, in <module>
from pip._internal.main import main
ImportError: No module named _internal.main
修改pip文件,这里的pip是文件,可以直接编辑
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
from pip._internal.main import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
修改为:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import sys
# from pip._internal.main import main
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
即可解决如上报错问题,安装包文件时将不会出现报错!