Search code examples
pythonsetuptools

How setuptools deals with transitive dependencies?


Let's say I have a setuptools project that depends on

  • PyPi package A, v. 1.0.
  • PyPi package B, v. 1.0.

and package B depends on A, v. 2.0.

In Java I would have to exclude transitive dependencies in pom.xml or similar. How does it work in setuptools? Can multiple versions of the same package live together in an installation?


Solution

  • This won't work with setuptools; you cannot override dependencies like that, for good reasons.

    What you describe is a broken dependency; you'll have to resolve this manually (probably by pinning package A to v. 2.0).