代码语言:javascript复制
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python3设置默认源时报错
代码语言:javascript复制Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
输入命令
代码语言:javascript复制sudo /usr/bin/pip3
将
代码语言:javascript复制from pip import main
if __name__ == '__main__':
sys.exit(main())
改为
代码语言:javascript复制from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())