pipenv install
command reference here.
-i, --index Target PyPI-compatible package index url.
--pypi-mirror Specify a PyPI mirror.
Besides, environment variable PIP_INDEX_URL
corresponds to --index
, PIPENV_PYPI_MIRROR
corresponds to --pypi-mirror
,
If I get a pypi mirror url, what's the difference between passing it as --index=<url>
and as --pypi-mirror=<url>
? It seems that both methods work for me.
this is an interesting question, the doc of pipenv is unclear on the difference of those two options, then the best source is its source code, as of version v2018.11.26, its behavior roughly like:
--index
, they formed the source list of packages, they could be the PyPI url or a private repository url.--pypi-mirror
could be specified.--pypi-mirror
is used, for each PyPI source url in the source list, would be replaced with mirror url.pip install
, with --index-url
, and --extra-index-url
option if there is more than one source.if you only install from PyPI, the net effect of both methods is the same.