Python from uv cache interferes with Python in pixi environment during CMake's FindPython #2749
Open
2 tasks done
Labels
🐞 bug
Something isn't working
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pixi, using
pixi --version
.Reproducible example
This is detailed in the issue, but it's a slight variant from the pixi pybind11 example
Issue description
I found a bug relating to the virtual environment found during FindPython in cmake inside
pixi
.Reproducible example:
Take the pixi pybind11 example, and make the following modifications:
Updated pyproject.toml:
This adds NumPy as a build dependency + added some additional scikit-build-core properties.
Updated CMakeLists.txt:
This uses FindPython to try and find the Python interpreter.
Here's the output when running
pixi run build
:Although the build is successful, the important part to focus on is the following:
Instead of finding the Python inside
.pixi/envs/build
, it finds a Python from uv cache. This is a problem because this Python won't have the appropriate libraries.To make the build fail, edit the
find_package
line in theCMakeLists.txt
to the following:The build fails since it cannot find the NumPy Include Directories:
I've tried some ways in CMake to find the python from the
build
environment, but I wasn't successful. I think this is a bug sincepixi
should remove this Python executable or at least not add it to PATH or set the VIRTUAL_ENV variable, which makes CMake's FindPython stop at this Python.I'm not sure if this is a bug in
pixi
orrattler
, so let me know if I need to post this in another repo! Thanks and happy holidays!Expected behavior
PYTHON_EXECUTABLE
should be set as.pixi/envs/build/bin/python
instead of the uv cache python inside a temporary directoryThe text was updated successfully, but these errors were encountered: