Python – pip install seems to be ignoring dependency links

pippython

I have a Python application that depends on several packages. One of those packages, unfortunately, isn't in PyPi so I have to install it directly from the git repo.

I've been trying to add it into my setup.py like so:

setup(
..,
..,
dependency_links = [
                 'https://github.com/marcuz/libpynexmo.git#egg=nexmomessage'
    ],
install_requires=[
    ..,
    'nexmomessage'
],
packages=['localpackage']

However it fails: No distributions at all found for nexmomessage

I see where it creates the dependency links list: writing dependency_links to common.egg-info/dependency_links.txt – and when I look at that file the URL is correct.

If I run it at command line: pip install -e git+https://github.com/marcuz/libpynexmo.git#egg=nexmomessage

It installs without an issue.

Thoughts?

Best Answer

As of pip 1.5, dependency links are deprecated. Currently pip can still be forced to be used them with the --process-dependency-links flag. You might also have to use --allow-external packagename or --allow-unverified packagename, where packagename actually specifies whichever dependency you want to install that's not in an official repository

Note that since it's deprecated functionality, the --process-dependency-links flag will be completely removed soon. I believe the preferred approach is to supply a requirements.txt file.