-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: Can't find pybind11 headers when building from source #29741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Without build isolation in pip, you need to install build dependencies before Matplotlib. The For now, you should install the build dependencies first (you can use |
Even if I go through conda, and I have |
I suspect this might be because |
I tried installing a c and cxx compiler into the conda environment (as should now happen anyway after #28352), and it didn't help. I'm still getting errors finding
|
This doesn't look right. Do you have the wrong |
Ah, thanks - I have no idea why that's where the build is trying to find the pybind11 headers, perhaps because I installed and uninstalled it in the past using |
I tracked this issue down. It happens when e.g. no pybind11 is installed globally but pybind11 is installed locally in user's home directly. Global install can be done with The reason is the following.
I'd say the cause is at pybind11-config. Meson and matplotlib just invoke it. Temporary workaround is of course to install globally. |
Bug summary
On macOS I am failing to build Matplotlib from source, because the c++ compiler cannot find Pybind11 headers. I've followed instructions at https://matplotlib.org/devdocs/devel/development_setup.html, and I get the same issue in a virtual environment, a virtual environment managed with
uv
, and aconda
environment.I have pybind11 installed globally (using
brew
), and in the Python virtual environment:Code for reproduction
Actual outcome
Expected outcome
A working install
Additional information
No response
Operating system
macOS
Matplotlib Version
Latest
main
branchMatplotlib Backend
No response
Python version
Python 3.12.8
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: