pip icon indicating copy to clipboard operation
pip copied to clipboard

Strange backtracking

Open kotopesutility opened this issue 11 months ago • 11 comments

Description

pip chooses the freshest pre-release version of package as a dependency, but if it is not compatible with the freshest version of the next package dependency it chooses another version of the first package instead of the second one.

Expected behavior

According to backtracking algorithm description and this page pip should try to choose another version of incompatible dependency (if it is possible) instead of choosing other versions of already chosen dependencies

pip version

24.0

Python version

Python 3.12.2

OS

ALT Linux

How to Reproduce

pip3 install -I --dry-run --pre triad==0.9.5

Output

pip3 install -I --dry-run --verbose --pre triad==0.9.5 Would install appdirs-1.4.4 fs-2.4.16 fsspec-2024.3.1 numpy-1.26.4 pandas-2.2.1 pyarrow-15.0.2 python-dateutil-2.9.0.post0 pytz-2024.1 setuptools-69.2.0 six-1.16.0 triad-0.9.5 tzdata-2024.1

But if I run pip3 install --dry-run --verbose --ignore-installed --pre triad==0.9.5 numpy==2.0.0b1 Would install appdirs-1.4.4 fs-2.4.16 fsspec-2024.3.1 numpy-2.0.0b1 pandas-2.2.0rc0 pyarrow-14.0.2 python-dateutil-2.9.0.post0 pytz-2024.1 setuptools-69.2.0 six-1.16.0 triad-0.9.5 tzdata-2024.1

Both time pip first select numpy-2.0.0b1 and then takes pandas, but for the first command it drops numpy-2.0.0b1. Maybe because it is not compatible with pandas-2.2.1, but if so, then it should take pandas-2.2.0rc0

Code of Conduct

kotopesutility avatar Mar 23 '24 21:03 kotopesutility