2

Formerly with setuptools, a Python dependency that needed to be installed from an extra index URL could just be added to dependency_links. Example from the answer here:

from setuptools import setup

setup(
    name='somepackage',
    install_requires=[
        'somedep'
    ],
    dependency_links=[
        'https://pypi.example.org/pypi/somedep/'
    ]
    # ...
)

But now that dependency_links is ignored, how do I install a package from a different index url with setuptools? The docs basically say to use VCS or dependency_links, but I'm unable to use the former and the latter doesn't work anymore.

  • This question has been asked many times already. Please search. -- Short answer you can't. You have to deal with this differently. – sinoroc Aug 16 '21 at 21:48
  • 4
    I don't think this specific question has been asked in the past 3 years since dependency_links has been deprecated. For example, the linked question I posted has people following up asking how to do it now. Any advice on how to deal with this differently? – Trent McCormick Aug 16 '21 at 22:17
  • @TrentMcCormick You can list extra URLs in the [`pip` command line](https://pip.pypa.io/en/stable/cli/pip_install/#install-extra-index-url), environment variables or [configuration files](https://pip.pypa.io/en/stable/topics/configuration/). You cannot list them in `setup.py`. – phd Aug 17 '21 at 14:45
  • 3
    Some pointers: https://stackoverflow.com/a/57704447 (read the comments as well) -- https://stackoverflow.com/a/58708235 -- https://stackoverflow.com/a/57978269 -- https://stackoverflow.com/a/66909248 -- https://stackoverflow.com/a/67344547 -- Sorry, I don't seem to find a good comprehensive canonical answer. -- Basically you should assume that `dependency_links` does not exist, it is now considered as somewhat of a "misfeature", and nowadays the user doing the install should be in charge of choosing the indexes, and not the creator of the package. – sinoroc Aug 17 '21 at 17:21

0 Answers0