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设置默认源时报错
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
输入命令
sudo vi /usr/bin/pip3
将
from pip import main
if __name__ == '__main__':
sys.exit(main())
改为
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())