I am creating libraries for a large project called main
. I'm having trouble understanding Python/pip's behavior when the following dependency structure exists:
main
depends onlib1
, which depends onlib2==1.0.0
.main
depends onlib2==2.0.0
.
Displayed as a tree,
main
- lib2==2.0.0
- lib1==x.x.x
- lib2==1.0.0
This creates a bit of a snafu as my main project depends on an API provided by v2 of lib2
yet another one of the main project's dependencies depend on an earlier version of lib2
.
What is Python/pip's behavior in this case? Will both libraries be installed and retained? Is there any way to gracefully resolve this version conflict?
(In npm
, for example, both versions of the library will be installed and the correct version is required by the appropriate dependent library.)