4

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.

4
  • This question has been asked many times already. Please search. -- Short answer you can't. You have to deal with this differently. Commented Aug 16, 2021 at 21:48
  • 5
    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? Commented Aug 16, 2021 at 22:17
  • @TrentMcCormick You can list extra URLs in the pip command line, environment variables or configuration files. You cannot list them in setup.py. Commented Aug 17, 2021 at 14:45
  • 4
    Some pointers: stackoverflow.com/a/57704447 (read the comments as well) -- stackoverflow.com/a/58708235 -- stackoverflow.com/a/57978269 -- stackoverflow.com/a/66909248 -- 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. Commented Aug 17, 2021 at 17:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.