What is the difference between the -find-links and -index-url pip flags?

Considering the documentation pip, it is not clear to me what the difference is between specifying a URL --find-linksor --index-url/--extra-index-urlfor additional packages.

The documentation states :

-i, --index-url <url>

The base URL of the Python package index (default is https://pypi.python.org/simple ). This should indicate a repository compatible with PEP 503 (simple repository API) or a local directory laid out in the same format.

-f, --find-links <url>

If the URL or path to the html file, analyze the links to the archives. If the local path or file: // url is that directory, then look for archives in the directory list.

As far as I understand, there is no real difference between them, except that index URLs must follow PEP 503 . I assume that the usual logic is to choose the latest version from all available.

Are there any other conceptual differences between the two that I missed? If so, which ones? If not, why have both?

+4
source share
1 answer

index-urlcan be considered a page on which there are only packages. You say you need to find what you want to install on this page; and this page is in a predictable format according to PEP 503. The index will list only the packages available to it.

find-links - . , URL- TAR WHEEL, HTML, git ..

, , .

, pip " " pip/test_index.pyp.

+3

Source: https://habr.com/ru/post/1687161/


All Articles