3 ms·
You can change the pypi index URL with `pip config set global.index-url`. For example, as a Chinese, I often switch to `https://pypi.tuna.tsinghua.edu.cn/simpl
by netheril96 4y ago
You can change the pypi index URL with `pip config set global.index-url`.
For example, as a Chinese, I often switch to `https://pypi.tuna.tsinghua.edu.cn/simple https://pypi.tuna.tsinghua.edu.cn/simple`. You may need to look up which one is available and faster in your region.
- occoder 4y agoThank you! This tip may just be the cure. But I shouldn't need to know this, pip should have taken care of picking the best download mirror. Or it could just support resuming a previous download. I don't actually mind waiting for a slow download or having to rerun pip install a few times, as long as it makes progress each time I run it.
- n8henrie 4y agoPeople should be aware that adding additional mirrors (instead of switching mirrors as suggested here) can lead to big slowdowns, as pip has no way to determine whether a given / found wheel is the m best choice without comparing all options, so it will continue to search both locally and all available indices until it can resolve the "best" wheel to download. Some discussion: https://discuss.python.org/t/why-does-pip-reach-out-to-indices-when-a-local-file-is-available/8920 https://discuss.python.org/t/why-does-pip-reach-out-to-indic... I don't recall if this issue is solved by specifying hashes (or perhaps even pinned versions are adequate) -- I would hope so.
- uranusjr 4y agoNote that in this instance the user is setting index-url, so no additional indexes are added, but the default index is replaced. So as long as the replaced index is faster, it will result in a faster install. It’s the extra-index-url option that should be used with caution.
- n8henrie 4y agoIndeed! Which is why I specified: > adding additional mirrors (instead of switching mirrors as suggested here)