Solving a pip issue using a range vs removing package range altogether

Question:

I’m getting a conflict with a pip install and I get this message:

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

So if I have, let’s say:

pandas==1.1.2

I could put:

pandas>=1.1.0,<1.1.4

But would using:

pandas

simply look through all possibilities and fix it itself?

I’m not sure If I’m being clear, but basically, if I don’t care about version number, can I just use no versions as a better solution, because it would implicitly go through the all the ranges?

Asked By: PharaohAtem

||

Answers:

Yes, running the command
pip install pandas will find the most recent version that can be used.

Answered By: linger1109

While this might fix your issue as @linger1109 suggested, it is highly recommended to specify a version number in your dependency manifest (e.g. requirements.txt.

There is no guarantee that future versions of pandas are fully backwards compatible, meaning the next time you install your dependencies, pip might opt for a newer version of pandas, potentially breaking your code.

I’d suggest finding versions of dependencies that are compatible with each other and declaring them in your dependencies manifest.

Answered By: ksbg
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.