MirrorZ Help

PyPI 软件仓库镜像使用帮助

选择镜像

PyPI 镜像在每次同步成功后间隔 5 分钟同步一次。

pip

临时使用

pip install -i https://(Loading...)/web/simple some-package

注意,simple 不能少。 pip 要求使用 https ,因此需要 https 而不是 http

设为默认

升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

python -m pip install --upgrade pip
pip config set global.index-url https://(Loading...)/web/simple

如果您到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:

python -m pip install -i https://(Loading...)/web/simple --upgrade pip

配置多个镜像源

如果您想配置多个镜像源平衡负载,可在已经替换 index-url 的情况下通过以下方式继续增加源站:

pip config set global.extra-index-url "<url1> <url2>..."

请自行替换引号内的内容,源地址之间需要有空格

例如

pip config set global.extra-index-url "https://(Loading...)/web/simple"

PDM

通过如下命令设置默认镜像:

pdm config pypi.url https://(Loading...)/web/simple

Poetry

通过以下命令设置默认镜像:

poetry source add --default mirrors https://(Loading...)/web/simple/

通过以下命令设置次级镜像:

poetry source add --secondary mirrors https://(Loading...)/web/simple/

Homebrew

本节主要供 Homebrew 帮助使用。

export HOMEBREW_PIP_INDEX_URL="https://(Loading...)/web/simple"

这个页面的内容有问题?在 GitHub Issue 反馈

想完善这个页面?查看我们的贡献指南在 GitHub 上查看此页的源代码

本页面的全部内容在 CC BY-NC-SA 4.0 协议之条款下提供,附加条款亦可能应用。