uv: Can't install `chumpy`
uv version
uv 0.4.7 (a178051e8 2024-09-07)
Reproduce:
uv add chumpy
It’s similar to #1551 but the solution don’t work:
- Use
uv init --libto create a project that allows[build-system] - Modify the
[build-system]to - Use
uv add chumpy, and get an error
uv add pip/uv pip install pip then uv add chumpy/uv pip install chumpy don’t work.
uv add pip/uv pip install pip then uv run pip install chumpy/uv run python -m pip install chumpy don’t work. (NOTE: they work when there is a cached wheel.)
But pixi can handle this.
pixi add python pip
pixi run pip install chumpy
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (19 by maintainers)
Sadly this is an issue with
chumpyitself. The package is not properly structured – it’s documented as such here: https://github.com/astral-sh/uv/issues/2252#issuecomment-1981978204. For example, it also won’t work if you runpip install chumpy --use-pep517, which will eventually be the default in pip:(In the pixi example you included, that’s just pixi running
pipwithin an environment, there’s no special handling there that differs frompip install.)You can either use
uv pip install chumpy --no-build-isolation, or see the docs on using build isolation withuv addand related APIs.I think the difference is that
uv lockruns in the system Python interpreter (since we’re not doing any install operations), which happens to havesetuptoolsinstalled in the environment (this isn’t true of later versions of Python, like Python 3.12), whereas withuv sync, we run in the project virtual environment, which doesn’t includesetuptoolsby default. If the project had a build-time dependency other thansetuptoolsandpip, both versions would fail. So it kind of works by accident.You can probably get the
uv lockversion to fail (I assume) by runninguv venvfirst?Yeah I think to explore further I’d need a consistent reproduction (I’d suggest running
uv cache cleanandrm -f uv.lockbefore any sequence of commands).