astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
28.42k stars 808 forks source link

`uv pip freeze` results in unsatisfiable requirements #9608

Open augustebaum opened 16 hours ago

augustebaum commented 16 hours ago

This seems like it might a known issue, but my search for similar issues has been unsuccessful so far.

Long story short:

$ uv pip freeze --verbose
DEBUG uv 0.5.5
DEBUG Searching for default Python interpreter in virtual environments or search path
DEBUG Found `cpython-3.12.5-linux-x86_64-gnu` at `/home/auguste/Desktop/skore/.venv/bin/python3` (active virtual environment)
Using Python 3.12.5 environment at: /home/auguste/Desktop/skore/.venv
...
jsonschema-specifications==2023.12.1
jsonschema-specifications==2024.10.1
...

I'm on NixOS with uv 0.5.5. Please let me know if there's any other information I can give.

zanieb commented 16 hours ago

It's possible for your environment to have multiple versions of a package installed, since each pip install operation is independent. I think it's correct for us to emit both in this case.

zanieb commented 16 hours ago

Generally, the best way to avoid this is use a higher-level interface like uv add, uv sync, and uv export which will not allow multiple versions.