Suppose I want to install package a
which requires the packages b1
and b2
. In turn, b1
requires c > 1.0.0
In principle / other programming languages, this is not a problem. One could install two versions of
c
side by side and make sure thatb1
uses another version thanb2
.
That's not a solution. If c
manages a shared resource (console, e.g.) sooner or later b1
and b2
will stomp each other input or output via different c
s and you end up with incorrect input and garbage output.
What you describe is a general problem, not limited to Python or pip
. The only solution is to change b1
and/or b2
to agree on a version of c
. Either downgrade b1
to allow c < 1.0
or upgrade b2
to allow c > 1.0
.
Can
pip
install two versions of one package?
No, and the problem is not in pip
but in Python: its import system doesn't allow importing from different versions of the same package. You can look at mitsuhiko/multiversion (Python2-only).