pip 换国内源

pip在安装python包时,默认使用的是国外的源,所以有时下载会比较慢,可以在install时将源指定为国内的源,比如阿里源或者清华源,

临时使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

设为默认

pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

同样的上述配置也可以使用阿里源:

http://mirrors.aliyun.com/pypi/simple

清华大学开源软件镜像站

你可能感兴趣的:(实用工具与技巧)