pip升级:python -m pip install --upgrade pip
pip3升级:python3 -m pip install --upgrade pip
pip3更新后出现问题:ImportError: cannot import name 'main' ,解决方法如下:
1. cd /usr/bin
2. sudo nano pip3
3.将原文件修改为:
from pip import __main__
if __name__ == '__main__':
sys.exit(__main__._main())
pip换源:sudo pip3 install XXX -i https://pypi.douban.com/simple/ (这里XXX就是你要安装的pack)