7

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?

Dave Holland
  • 1,898
  • 1
  • 13
  • 17

2 Answers2

6

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.

detly
  • 192
  • 1
  • 3
  • 11
  • Indeed, this was the conclusion I came to in September as well. Though it was odd that it was able to run from command line without the flags, but not in the setup.py. In the end I contacted the author and made a heartfelt plea he get his packages up to pypi to make life easier :) – Dave Holland Sep 16 '14 at 17:28
  • 2
    According to the 1.5 release-notes, dependency links are not "deprecated" - it is the `--process-dependency-links` that is needed to process them. Additionally, since 8.0.0, you may add this option in a new line in requirements-file, so that the user does not have to type it in the command-line (see [pip#1274](https://github.com/pypa/pip/issues/1274). – ankostis Jan 10 '17 at 11:51
2

And as of pip 7 they are enabled again. This means you can now use dependency_links using pip:

pip install -e /path/to/python/module --process-dependency-links --allow-all-external

If you'r using your distros system pip you might need to upgrade pip:

pip install pip --upgrade

Appears to have happened in pull request #1519

Niklas B
  • 381
  • 1
  • 2
  • 7
  • 2
    Aand in pip `pip 9.0.1` when I do this I get `DEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.` and `DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release.` – Peter Jun 13 '17 at 13:08