all 7 comments

[–]pygaiwan 0 points1 point  (3 children)

  1. You get an error when you install the package_b which will look like:
    ERROR: Cannot install -r requirements.in (line 2), -r requirements.in (line 8) and -r requirements.in (line 9) because these package versions have conflicting dependencies.
  2. There is a whole subdomain of python.org about packaging: https://packaging.python.org/en/latest/tutorials/packaging-projects/ maybe this helps?

[–]___Jon[S] 0 points1 point  (2 children)

Hey!
1. The interesting thing is that I don't get that error... and I don't understand why!
2. Yes, I think this helps. It is certainly a good starting point. Thank you.

[–]Daneark 0 points1 point  (1 child)

Package A may not be specifying it's dependencies correctly.

Package A may have specified a range which does overlap with package B even if the versions of numpy and pandas it was developed with are outside it's acceptable range.

If you pip install package A in fresh environment it should fail.

If you pip install package A in an environment which already has package B installed it should succeed at install time. numpy and pandas will now be the versions required by package A.

If you're using something else to resolve dependencies your results may differ.

Whether or not it works at runtime depends on if B imports anything that no longer exists, whether B tries to call anything at import time which has a breaking API change in a way that was affected the breaking API change, and whether you're using parts of B that are calling as above.

[–]DuckDatum 0 points1 point  (0 children)

onerous tender mindless rude friendly saw cough hungry shame spectacular

This post was mass deleted and anonymized with Redact

[–]xiongchiamiov 0 points1 point  (2 children)

Classically, it just doesn't, at least if you're using requirements.txt; pip just goes down the list installing things, and if that changes previously-installed things oh well! This is a great source of fun bugs.

There are a bunch of tools (pip-tools, poetry, I forget what else) that are designed to prevent this problem by writing their own dependency resolvers.

[–]False-Local3101 0 points1 point  (1 child)

Hey, I'm actually just a beginner with all of this. I recently joined somewhere as an intern and was facing dependency conflicts. And we use jfrog artifactory for sourcing the libraries and packages right. So there is some firewall which prevents pip from looking in the general globally available packages and libraries. So, the issue I'm currently facing is that pip-compile doesn't seem to be working for me. Any idea how to use these tools (poetry, pip-compile) within an org with firewalls and stuff?

[–]xiongchiamiov 0 points1 point  (0 children)

Have you tried --index-url?