# 临时修改
# 在安装命令后加上指定源选项
pip install pymysql -i https://mirrors.aliyun.com/pypi/simple/
# 永久修改
# 编辑 ~/.pip/pip.conf 文件,若不存在自行创建即可
# vim ~/.pip/pip.conf
1 [global] 2 timeout = 8 3 index-url = http://mirrors.aliyun.com/pypi/simple/ 4 extra-index-url= http://pypi.douban.com/simple/ 5 [install] 6 trusted-host= 7 mirrors.aliyun.com 8 pypi.douban.com
说明:
a、此为设置pip的配置文件;
b、第2行是设置超时时间,单位秒;
c、第3行是指定优先下载源,第4行是备用下载源;
d、6~8行内容是配置可能需要使用https方式通信。