I have dependency_links in my setup.py:
...
dependency_links = ['http://github.com/robot-republic/python-s3/tarball/master.tar.gz#egg=python-s3'],
...
But it doesn't work. However install_requires works fine. Maybe there are another method to set up git repo as required for setup.py?
I realize this is an old question, but, just in case you find yourself here like I did, this is what worked for me.
I've got a package on GitHub (not registered with pypi) that relies on other GitHub (non-pypi) packages. I spent an inordinate amount of time trying to figure out how to get pip to handle this correctly. I will include what I did to fix it here.
Putting dependencies in a requirements.txt file is the preferred method of listing dependencies. However, you also need to populate install_requires in setup. It was at this stage that I ran into a roadblock with pip not wanting to install dependencies from GitHub.
Most places, including answers to this question, tell you to populate the dependency_links section of setup. However, you also need to populate the install_requires field with the name of the package referenced in dependency_links.
For example, if your requirements.txt contains the following.
Then, your setup call should look like this:
Ok, so now we've got our package configured; installing it is the next task. This is where I spent a lot of time. I could not figure out why specifying dependency_links apparently did nothing. The trick is that in some cases, you need to set the allow-all-external (can be more specific) flag for pip. For example:
You're done and it works!
DISCLAIMER: dependency_links and the flags process-dependency-links and allow-all-external are deprecated, so they will be removed soon. In the time I spent, I could not locate a better, prefered method and still have pip function properly.
This answer should help. In a nutshell, you need to specify the version (or "dev") for the
#egg=python-s3
so it looks like#egg=python-s3-1.0.0
.Updates based on @Cerin's comment:
--process-dependency-links
. I haven't tested it because I agree with the point below.A couple of notes on some issues I found, in particular for installing from private repos.
Installing from pip & setuptools have some subtle differences; but this way should work for both.
A couple of notes here:
0
) at the end of the link, even if there's no package on PyPI. This has to be a actual number, not a word.git+
to tell setuptools it's to clone the repo, rather than pointing at a zip / tarballversion
can be a branch, a tag, or a commit hash--process-dependency-links
if installing from pip