Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a flexible requirement is present in the dependency tree, pip does not respect hard-pinned requirements further down the tree #2981

Closed
FragLegs opened this issue Jul 17, 2015 · 1 comment
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@FragLegs
Copy link

A flexible requirement at one point in the dependency tree will override a non-flexible requirement further down. A concrete example (where all dependencies are specified in each project's setup.py install_requires) is presented below. I am installing from a private pypi repository, although I don't think that has anything to do with the issue.

ProjectA(v0.0.3) depends on ProjectB==1.2.3 and skll==0.23.1
ProjectB(v1.2.3) depends on ProjectC==0.3.13
skll(v0.23.1) depends on scikit-learn>=0.14
ProjectC(v0.3.13) depends on scikit-learn==0.15.1

Running pip install -i myprivatepypi.com ProjectA==0.0.3, you will wind up with the latest scikit-learn (currently 0.16.1) instead of 0.15.1. The following message appears in the stdout:

Collecting scikit-learn>=0.14 (from skll==0.23.1->ProjectA==0.0.3) Downloading https://myprivatepypi.com/scikit-learn-0.16.1.tar.gz (7.3MB)

There is no mention of downloading or installing scikit-learn==0.15.1 as specified by ProjectC and pip freeze shows that, in fact, scikit-learn==0.16.1 has been installed.

This behavior happens in pip 6.1.1 and 7.1.0.

@qwcode
Copy link
Contributor

qwcode commented Jul 17, 2015

this is a dupe of #988

there is a workaround for this though using requirements files. see use case #2 here: https://pip.pypa.io/en/stable/user_guide.html#requirements-files

in your requirements file, you'd have:

ProjectA==0.0.3
scikit-learn==0.15.1

@qwcode qwcode closed this as completed Jul 17, 2015
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants