question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dependency_links flag ignored when package exists on PyPI

See original GitHub issue

I am relying on pyswarm for a package I am working on. PyPI’s latest version is 0.6, but I need 0.7, which is only on GitHub. My stripped-down setup function is below:

from setuptools import setup, find_packages

setup(
    name='mypackage',
    version='0.1',
    packages=find_packages(exclude=('examples', 'docs')),
    install_requires=['pyswarm>=0.7'],
    dependency_links=[
        "git+https://github.com/tisimst/pyswarm",
    ]
)

As shown here, the install fails with:

$ pip install mypackage
...
Could not find a version that satisfies the requirement pyswarm>=0.7 (from mypackage==0.1) (from versions: 0.5, 0.6)
No matching distribution found for pyswarm>=0.7 (from mypackage==0.1)

However, installing via pip works perfectly fine, satisfying pyswarm>=0.7:

$ pip install git+https://github.com/tisimst/pyswarm
Collecting git+https://github.com/tisimst/pyswarm
  Cloning https://github.com/tisimst/pyswarm to /tmp/pip-0k6viimo-build
Requirement already satisfied: numpy in /home/sean/opt/anaconda3/lib/python3.5/site-packages (from pyswarm==0.7)
Installing collected packages: pyswarm
  Running setup.py install for pyswarm ... done
Successfully installed pyswarm-0.7

Why is dependency_links being ignored when setup() attempts to find pyswarm-0.7? It appears that versions 0.5 and 0.6 are found on PyPI (and do not satisfy the requirements), but version 0.7 is not found via the GitHub link despite the fact that pip installs from the same link just fine.

My current workaround is to run pip install git+https://github.com/tisimst/pyswarm via subprocess.call() before setup() is called (thus satisfying the pyswarm>=0.7 requirement), but this should not be necessary.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:11
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
benoit-pierrecommented, Jul 27, 2017

It’s because your missing a version in your link, since you ask for hbmqtt>0.9.0, either use:

install_requires=[
   'hbmqtt'
],
dependency_links=[
   'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt'
],

or better tag your link version, e.g.:

install_requires=[
    'hbmqtt>0.9.0'
],
dependency_links=[
    'git+https://github.com/beerfactory/hbmqtt.git@f4330985115e3ffb3ccbb102230dfd15bb822a72#egg=hbmqtt-0.9.1.dev'
],
3reactions
krautcatcommented, Nov 3, 2017

@gijzelaerr, if I can remember, this flag didn’t help me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pip ignores dependency_links whlie installing package from ...
I am packaging my own Python package. I use setuptools and wheel for bundling it and pip for installing (both in develop mode...
Read more >
pip install pip==1.0.2 - PyPI
pip is a tool for installing and managing Python packages, such as those found in the ... Added --no-deps option to install ignore...
Read more >
pip install — pip 10.0.0.dev0 documentation
Install packages from: PyPI (and other indexes) using requirement specifiers. VCS project urls. Local project directories. Local or remote source archives.
Read more >
Changelog - pip documentation v22.3.1
Ensure that the candidate pip executable exists, when checking for a new version of pip. (#11309). Ignore distributions with invalid Name in metadata ......
Read more >
pip install seems to be ignoring dependency links - Server Fault
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.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found