I want to constraint some packages to be explicitly the latest available version so that the conflict resolver doesn't downgrade them ever. In pseudocode: pip install -U pip==latest
.
Asked
Active
Viewed 597 times
0

HappyFace
- 3,439
- 2
- 24
- 43
-
`pip install -U x` already installs the latest available version of `x` – 0dminnimda Aug 31 '21 at 08:16
-
`pip install -help` : `-U, --upgrade Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.` – 0dminnimda Aug 31 '21 at 08:17
-
@0dminnimda Not when you specify multiple packages (at least not with `-r requirements.txt`) and they conflict. – HappyFace Aug 31 '21 at 08:58
-
Maybe [this](https://stackoverflow.com/q/24764549) can help? – 0dminnimda Aug 31 '21 at 09:00
-
@HappyFace 2 problems with your approach: 1) `pip` doesn't have a notion of "the latest version" so it's impossible to pin a package to it; 2) even if there would be a way `pip` would recognize the version incompatible with the rest of your dependencies and would refuse to install anything at all. The only workaround I recommend to try: 1st install all packages normally allowing `pip` to install any version of the main package; 2nd upgrade the main package separately: `pip install --no-deps --upgrade package` – phd Aug 31 '21 at 09:13
-
@phd I want all the packages to be the latest, the conflicts be damned. – HappyFace Aug 31 '21 at 12:02
-
@HappyFace No way. `pip` prefers to resolve conflicts or fail with an error. To install all the latest versions install packages one by one without dependencies. But I wonder what you gonna do when incompatible packages would start throwing error after error? – phd Aug 31 '21 at 12:47