5

TL;DR

How can I instruct setuptools to ignore dependency conflicts and carry on normally?

Background

My Python project has a set of Google Cloud dependencies declared in a requirements.txt file. These Google Cloud dependencies have a transitive dependency conflict that is ultimately resolved and the application seems to function properly.

Executing pip install -r requirements.txt completes successfully and pipdeptree reports these conflicts, but python setup.py install fails due to these conflicts.

Warnings produced by pipdeptree

Warning!!! Possibly conflicting dependencies found:
* gapic-google-cloud-pubsub-v1==0.15.3
- oauth2client [required: >=2.0.0,<4.0dev, installed: 4.0.0]
* google-gax==0.15.8
- oauth2client [required: >=2.0.0,<4.0dev, installed: 4.0.0]
* grpc-google-cloud-pubsub-v1==0.14.0
- oauth2client [required: >=2.0.0,<4.0dev, installed: 4.0.0]
* proto-google-cloud-pubsub-v1==0.15.3
- oauth2client [required: >=2.0.0,<4.0dev, installed: 4.0.0]
* grpc-google-iam-v1==0.11.1
- oauth2client [required: <4.0.0dev,>=2.0.0, installed: 4.0.0]

Errors produced by python setup.py install

error: oauth2client 4.0.0 is installed but oauth2client<4.0dev,>=2.0.0 is required by set(['proto-google-cloud-pubsub-v1', 'gapic-google-cloud-pubsub-v1', 'google-gax'])
;
noamt
  • 7,397
  • 2
  • 37
  • 59
  • What does `transitive dependecy conflict` and how it can be `ultimately resolved`? – user1685095 May 28 '17 at 10:28
  • So the google cloud client libraries all depend on `oauth2client` - that's a transitive dependency. A dependency of a dependency. When a couple of dependency libraries all depend on different versions of another library - then it's a conflict. pip can resolve these conflicts by automatically selecting one version out of all the required, and locks on to that. – noamt May 28 '17 at 10:33
  • Oh, okay. I've researched a little. Seems that pip is resolving dependency conflict by taking the first dependency that he would find. Seems that It's done so that the user could specify dependency in cli to override other dependencies. Which isn't acceptable in setup.py script. If setup.py has dependency conflict (and it isn't actually needed) then the authors should fix that. But maybe I'm wrong. – user1685095 May 28 '17 at 10:42
  • Can't fix it myself in this case as it's a conflict between transitive dependencies of the Google libraries – noamt May 28 '17 at 11:19

1 Answers1

3

This is not possible. setuptools is strict in this way and conflicts must be resolved.

noamt
  • 7,397
  • 2
  • 37
  • 59