include "Python.h" fails in virtual environments managed by uv and conda due to wrong include path #720
-
I set up a project according to the one in the meson-python tutorial. The
This is obviously due to a wrong include path When I use a virtual environment created with
When I use a conda or uv managed environment it looks like
Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Obviously something is wrong in how conda and uv setup the virtual environment. However, I regularly uses both uv and conda managed virtual environments without any issue. Therefore, the problem is likely local to your installation, or specific to how you use these tools. It is not possible to diagnose the problem further with the provided information. It would be interesting to check how meson comes to determine the wrong include path. This information is recorded in the verbose meson log in the build directory. Please see here for how to access it when building a Python package |
Beta Was this translation helpful? Give feedback.
-
This looks like a bit of astral-sh/uv#10558 and a bit of astral-sh/uv#9857 Per @zanieb this should be fixed by telling (the latest version of) uv to reinstall python, can you try that? |
Beta Was this translation helpful? Give feedback.
-
Thanks to @dnicolodi and @eli-schwartz. Yeah, as it turns out is is a broken uv installation. My
with the Reinstalling uv from scratch helped. |
Beta Was this translation helpful? Give feedback.
Thanks to @dnicolodi and @eli-schwartz.
Yeah, as it turns out is is a broken uv installation. My
~/.local/share/uv/python/cpython-3.13.1-linux-x86_64-gnu/lib/pkgconfig/python-3.13.pc
looks like thiswith the
prefix=/install
leading to the-I/install
Reinstalling uv from scratch helped.