临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
注意,simple 不能少, 是 https 而不是 http
设为默认
修改 ~/.config/pip/pip.conf (Linux), %APPDATA%\pip\pip.ini (Windows 10) 或 $HOME/Library/Application Support/pip/pip.conf (macOS) (没有就创建一个), 修改 index-url至tuna,例如
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
pip 和 pip3 并存时,只需修改 ~/.pip/pip.conf。

本文介绍如何将Python的包管理工具pip设置为使用清华大学提供的开源软件包镜像站点。通过简单的配置修改,可以显著提高安装Python包的速度。适用于Linux、Windows及macOS等不同操作系统。
726

被折叠的 条评论
为什么被折叠?



