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 a conda environment.
I have pybind11 installed globally (using brew), and in the Python virtual environment:
% python -c "import pybind11; print(pybind11.__version__)"
2.13.6
Code for reproduction
python -m pip install --verbose --no-build-isolation --editable ".[dev]"
Actual outcome
% uv pip install --verbose --no-build-isolation --editable ".[dev]"
DEBUG uv 0.6.5 (Homebrew 2025-03-06)
DEBUG Searching for default Python interpreter in virtual environments
DEBUG Found `cpython-3.12.8-macos-aarch64-none` at `/Users/dstansby/software/matplotlib/.venv/bin/python3` (active virtual environment)
DEBUG Using Python 3.12.8 environment at: .venv
DEBUG Acquired lock for `.venv`
DEBUG At least one requirement is not satisfied: file:///Users/dstansby/software/matplotlib
DEBUG Using request timeout of 30s
DEBUG Found PEP 621 metadata for /Users/dstansby/software/matplotlib in `pyproject.toml` (matplotlib)
DEBUG No static `pyproject.toml` available for: matplotlib @ file:///Users/dstansby/software/matplotlib (DynamicField("version"))
DEBUG Acquired lock for `/Users/dstansby/.cache/uv/sdists-v8/editable/a93b495625504936`
DEBUG Preparing metadata for: matplotlib @ file:///Users/dstansby/software/matplotlib
DEBUG No workspace root found, using project root
DEBUG Proceeding without build isolation
DEBUG Calling `mesonpy.prepare_metadata_for_build_editable()`
Building matplotlib @ file:///Users/dstansby/software/matplotlib
DEBUG Building: matplotlib @ file:///Users/dstansby/software/matplotlib
DEBUG No workspace root found, using project root
DEBUG Proceeding without build isolation
DEBUG Calling `mesonpy.build_editable("/Users/dstansby/.cache/uv/builds-v0/.tmppFdYgl", {}, None)`
DEBUG + meson setup --reconfigure /Users/dstansby/software/matplotlib /Users/dstansby/software/matplotlib/build/cp312 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/Users/dstansby/software/matplotlib/build/cp312/meson-python-native-file.ini
DEBUG Cleaning... 0 files.
DEBUG The Meson build system
DEBUG Version: 1.7.0
DEBUG Source dir: /Users/dstansby/software/matplotlib
DEBUG Build dir: /Users/dstansby/software/matplotlib/build/cp312
DEBUG Build type: native build
DEBUG Program python3 found: YES (/Users/dstansby/software/matplotlib/.venv/bin/python3)
DEBUG Project name: matplotlib
DEBUG Project version: 3.11.0.dev547+gb0153b17b6
DEBUG C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
DEBUG C linker for the host machine: cc ld64 1115.7.3
DEBUG C++ compiler for the host machine: c++ (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
DEBUG C++ linker for the host machine: c++ ld64 1115.7.3
DEBUG Host machine cpu family: aarch64
DEBUG Host machine cpu: aarch64
DEBUG Program python found: YES (/Users/dstansby/software/matplotlib/.venv/bin/python3)
DEBUG Dependency pybind11 found: YES 2.13.6 (cached)
DEBUG
DEBUG Executing subproject freetype-2.6.1
DEBUG
DEBUG freetype-2.6.1| Project name: freetype2
DEBUG freetype-2.6.1| Project version: 2.6.1
DEBUG freetype-2.6.1| C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
DEBUG freetype-2.6.1| C linker for the host machine: cc ld64 1115.7.3
DEBUG freetype-2.6.1| Has header "unistd.h" : YES (cached)
DEBUG freetype-2.6.1| Has header "fcntl.h" : YES (cached)
DEBUG freetype-2.6.1| Has header "stdint.h" : YES (cached)
DEBUG freetype-2.6.1| Configuring ftconfig.h using configuration
DEBUG freetype-2.6.1| Configuring ftoption.h using configuration
DEBUG freetype-2.6.1| Build targets in project: 2
DEBUG freetype-2.6.1| Subproject freetype-2.6.1 finished.
DEBUG
DEBUG
DEBUG Executing subproject qhull
DEBUG
DEBUG qhull| Project name: qhull
DEBUG qhull| Project version: 8.0.2
DEBUG qhull| C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
DEBUG qhull| C linker for the host machine: cc ld64 1115.7.3
DEBUG qhull| Build targets in project: 3
DEBUG qhull| Subproject qhull finished.
DEBUG
DEBUG Dependency dl found: YES unknown (cached)
DEBUG Objective-C compiler for the host machine: clang (clang 16.0.0)
DEBUG Objective-C linker for the host machine: clang ld64 1115.7.3
DEBUG Dependency appleframeworks (modules: Cocoa) found: YES unknown (cached)
DEBUG Configuring _version.py using configuration
DEBUG Program /Users/dstansby/software/matplotlib/tools/generate_matplotlibrc.py found: YES (/Users/dstansby/software/matplotlib/tools/generate_matplotlibrc.py)
DEBUG Build targets in project: 13
DEBUG
DEBUG matplotlib 3.11.0.dev547+gb0153b17b6
DEBUG
DEBUG Subprojects
DEBUG freetype-2.6.1: YES
DEBUG qhull : YES
DEBUG
DEBUG User defined options
DEBUG Native files : /Users/dstansby/software/matplotlib/build/cp312/meson-python-native-file.ini
DEBUG b_ndebug : if-release
DEBUG b_vscrt : md
DEBUG buildtype : release
DEBUG
DEBUG Found ninja-1.11.1.git.kitware.jobserver-1 at /Users/dstansby/software/matplotlib/.venv/bin/ninja
DEBUG + /Users/dstansby/software/matplotlib/.venv/bin/ninja
DEBUG [1/23] Compiling C++ object src/_image.cpython-312-darwin.so.p/py_converters.cpp.o
DEBUG FAILED: src/_image.cpython-312-darwin.so.p/py_converters.cpp.o
DEBUG c++ -Isrc/_image.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_image.cpython-312-darwin.so.p/py_converters.cpp.o -MF src/_image.cpython-312-darwin.so.p/py_converters.cpp.o.d -o src/_image.cpython-312-darwin.so.p/py_converters.cpp.o -c ../../src/py_converters.cpp
DEBUG In file included from ../../src/py_converters.cpp:1:
DEBUG ../../src/py_converters.h:12:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 12 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [2/23] Compiling C++ object src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o
DEBUG FAILED: src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o
DEBUG c++ -Isrc/_c_internal_utils.cpython-312-darwin.so.p -Isrc -I../../src -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o -MF src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o.d -o src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o -c ../../src/_c_internal_utils.cpp
DEBUG ../../src/_c_internal_utils.cpp:19:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 19 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [3/23] Compiling C++ object src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o
DEBUG FAILED: src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o
DEBUG c++ -Isrc/_image.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o -MF src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o.d -o src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o -c ../../src/_image_wrapper.cpp
DEBUG ../../src/_image_wrapper.cpp:1:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 1 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [4/23] Compiling C++ object src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o
DEBUG FAILED: src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o
DEBUG c++ -Isrc/_tkagg.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o -MF src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o.d -o src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o -c ../../src/_tkagg.cpp
DEBUG ../../src/_tkagg.cpp:32:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 32 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [5/23] Compiling C++ object src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o
DEBUG FAILED: src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o
DEBUG c++ -Isrc/_qhull.cpython-312-darwin.so.p -Isrc -I../../src -I../../subprojects/qhull-8.0.2/src -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -DMPL_DEVNULL=/dev/null -MD -MQ src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o -MF src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o.d -o src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o -c ../../src/_qhull_wrapper.cpp
DEBUG ../../src/_qhull_wrapper.cpp:8:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 8 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [6/23] Compiling C++ object src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o
DEBUG FAILED: src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o
DEBUG c++ -Isrc/ft2font.cpython-312-darwin.so.p -Isrc -I../../src -I../../subprojects/freetype-2.6.1/include -I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 '-DFREETYPE_BUILD_TYPE="local"' -MD -MQ src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o -MF src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o.d -o src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o -c ../../src/ft2font_wrapper.cpp
DEBUG ../../src/ft2font_wrapper.cpp:2:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 2 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [7/23] Compiling C++ object src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o
DEBUG FAILED: src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o
DEBUG c++ -Isrc/_path.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o -MF src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o.d -o src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o -c ../../src/_path_wrapper.cpp
DEBUG ../../src/_path_wrapper.cpp:1:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 1 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [8/23] Compiling C++ object src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o
DEBUG FAILED: src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o
DEBUG c++ -Isrc/_backend_agg.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include -I../../subprojects/freetype-2.6.1/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o -MF src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o.d -o src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o -c ../../src/_backend_agg_wrapper.cpp
DEBUG ../../src/_backend_agg_wrapper.cpp:1:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 1 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [9/23] Compiling C++ object src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o
DEBUG FAILED: src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o
DEBUG c++ -Isrc/_backend_agg.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include -I../../subprojects/freetype-2.6.1/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o -MF src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o.d -o src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o -c ../../src/_backend_agg.cpp
DEBUG In file included from ../../src/_backend_agg.cpp:6:
DEBUG ../../src/_backend_agg.h:9:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 9 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG [10/23] Compiling C++ object src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o
DEBUG FAILED: src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o
DEBUG c++ -Isrc/ft2font.cpython-312-darwin.so.p -Isrc -I../../src -I../../subprojects/freetype-2.6.1/include -I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12 -I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 '-DFREETYPE_BUILD_TYPE="local"' -MD -MQ src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o -MF src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o.d -o src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o -c ../../src/ft2font.cpp
DEBUG In file included from ../../src/ft2font.cpp:13:
DEBUG ../../src/mplutils.h:54:10: fatal error: 'pybind11/pybind11.h' file not found
DEBUG 54 | #include <pybind11/pybind11.h>
DEBUG | ^~~~~~~~~~~~~~~~~~~~~
DEBUG 1 error generated.
DEBUG ninja: build stopped: subcommand failed.
DEBUG Released lock at `/Users/dstansby/.cache/uv/sdists-v8/editable/a93b495625504936/.lock`
× Failed to build `matplotlib @ file:///Users/dstansby/software/matplotlib`
├─▶ The build backend returned an error
╰─▶ Call to `mesonpy.build_editable` failed (exit status: 1)
[stdout]
+ meson setup --reconfigure /Users/dstansby/software/matplotlib /Users/dstansby/software/matplotlib/build/cp312 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md
--native-file=/Users/dstansby/software/matplotlib/build/cp312/meson-python-native-file.ini
Cleaning... 0 files.
The Meson build system
Version: 1.7.0
Source dir: /Users/dstansby/software/matplotlib
Build dir: /Users/dstansby/software/matplotlib/build/cp312
Build type: native build
Program python3 found: YES (/Users/dstansby/software/matplotlib/.venv/bin/python3)
Project name: matplotlib
Project version: 3.11.0.dev547+gb0153b17b6
C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
C linker for the host machine: cc ld64 1115.7.3
C++ compiler for the host machine: c++ (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
C++ linker for the host machine: c++ ld64 1115.7.3
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python found: YES (/Users/dstansby/software/matplotlib/.venv/bin/python3)
Dependency pybind11 found: YES 2.13.6 (cached)
Executing subproject freetype-2.6.1
freetype-2.6.1| Project name: freetype2
freetype-2.6.1| Project version: 2.6.1
freetype-2.6.1| C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
freetype-2.6.1| C linker for the host machine: cc ld64 1115.7.3
freetype-2.6.1| Has header "unistd.h" : YES (cached)
freetype-2.6.1| Has header "fcntl.h" : YES (cached)
freetype-2.6.1| Has header "stdint.h" : YES (cached)
freetype-2.6.1| Configuring ftconfig.h using configuration
freetype-2.6.1| Configuring ftoption.h using configuration
freetype-2.6.1| Build targets in project: 2
freetype-2.6.1| Subproject freetype-2.6.1 finished.
Executing subproject qhull
qhull| Project name: qhull
qhull| Project version: 8.0.2
qhull| C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.26.6)")
qhull| C linker for the host machine: cc ld64 1115.7.3
qhull| Build targets in project: 3
qhull| Subproject qhull finished.
Dependency dl found: YES unknown (cached)
Objective-C compiler for the host machine: clang (clang 16.0.0)
Objective-C linker for the host machine: clang ld64 1115.7.3
Dependency appleframeworks (modules: Cocoa) found: YES unknown (cached)
Configuring _version.py using configuration
Program /Users/dstansby/software/matplotlib/tools/generate_matplotlibrc.py found: YES (/Users/dstansby/software/matplotlib/tools/generate_matplotlibrc.py)
Build targets in project: 13
matplotlib 3.11.0.dev547+gb0153b17b6
Subprojects
freetype-2.6.1: YES
qhull : YES
User defined options
Native files : /Users/dstansby/software/matplotlib/build/cp312/meson-python-native-file.ini
b_ndebug : if-release
b_vscrt : md
buildtype : release
Found ninja-1.11.1.git.kitware.jobserver-1 at /Users/dstansby/software/matplotlib/.venv/bin/ninja
+ /Users/dstansby/software/matplotlib/.venv/bin/ninja
[1/23] Compiling C++ object src/_image.cpython-312-darwin.so.p/py_converters.cpp.o
FAILED: src/_image.cpython-312-darwin.so.p/py_converters.cpp.o
c++ -Isrc/_image.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include
-I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden
-fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_image.cpython-312-darwin.so.p/py_converters.cpp.o -MF
src/_image.cpython-312-darwin.so.p/py_converters.cpp.o.d -o src/_image.cpython-312-darwin.so.p/py_converters.cpp.o -c ../../src/py_converters.cpp
In file included from ../../src/py_converters.cpp:1:
../../src/py_converters.h:12:10: fatal error: 'pybind11/pybind11.h' file not found
12 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[2/23] Compiling C++ object src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o
FAILED: src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o
c++ -Isrc/_c_internal_utils.cpython-312-darwin.so.p -Isrc -I../../src -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden
-flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o
-MF src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o.d -o src/_c_internal_utils.cpython-312-darwin.so.p/_c_internal_utils.cpp.o -c
../../src/_c_internal_utils.cpp
../../src/_c_internal_utils.cpp:19:10: fatal error: 'pybind11/pybind11.h' file not found
19 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[3/23] Compiling C++ object src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o
FAILED: src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o
c++ -Isrc/_image.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include
-I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden
-fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o -MF
src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o.d -o src/_image.cpython-312-darwin.so.p/_image_wrapper.cpp.o -c ../../src/_image_wrapper.cpp
../../src/_image_wrapper.cpp:1:10: fatal error: 'pybind11/pybind11.h' file not found
1 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[4/23] Compiling C++ object src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o
FAILED: src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o
c++ -Isrc/_tkagg.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include
-I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden
-fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o -MF
src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o.d -o src/_tkagg.cpython-312-darwin.so.p/_tkagg.cpp.o -c ../../src/_tkagg.cpp
../../src/_tkagg.cpp:32:10: fatal error: 'pybind11/pybind11.h' file not found
32 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[5/23] Compiling C++ object src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o
FAILED: src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o
c++ -Isrc/_qhull.cpython-312-darwin.so.p -Isrc -I../../src -I../../subprojects/qhull-8.0.2/src
-I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden
-flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -DMPL_DEVNULL=/dev/null -MD -MQ src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o -MF
src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o.d -o src/_qhull.cpython-312-darwin.so.p/_qhull_wrapper.cpp.o -c ../../src/_qhull_wrapper.cpp
../../src/_qhull_wrapper.cpp:8:10: fatal error: 'pybind11/pybind11.h' file not found
8 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[6/23] Compiling C++ object src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o
FAILED: src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o
c++ -Isrc/ft2font.cpython-312-darwin.so.p -Isrc -I../../src -I../../subprojects/freetype-2.6.1/include
-I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden
-flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 '-DFREETYPE_BUILD_TYPE="local"' -MD -MQ src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o
-MF src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o.d -o src/ft2font.cpython-312-darwin.so.p/ft2font_wrapper.cpp.o -c ../../src/ft2font_wrapper.cpp
../../src/ft2font_wrapper.cpp:2:10: fatal error: 'pybind11/pybind11.h' file not found
2 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[7/23] Compiling C++ object src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o
FAILED: src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o
c++ -Isrc/_path.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include
-I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden
-fvisibility-inlines-hidden -flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o -MF
src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o.d -o src/_path.cpython-312-darwin.so.p/_path_wrapper.cpp.o -c ../../src/_path_wrapper.cpp
../../src/_path_wrapper.cpp:1:10: fatal error: 'pybind11/pybind11.h' file not found
1 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[8/23] Compiling C++ object src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o
FAILED: src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o
c++ -Isrc/_backend_agg.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include
-I../../subprojects/freetype-2.6.1/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden
-flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o
-MF src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o.d -o src/_backend_agg.cpython-312-darwin.so.p/_backend_agg_wrapper.cpp.o -c
../../src/_backend_agg_wrapper.cpp
../../src/_backend_agg_wrapper.cpp:1:10: fatal error: 'pybind11/pybind11.h' file not found
1 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[9/23] Compiling C++ object src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o
FAILED: src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o
c++ -Isrc/_backend_agg.cpython-312-darwin.so.p -Isrc -I../../src -I../../extern/agg24-svn/include
-I../../subprojects/freetype-2.6.1/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden
-flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 -MD -MQ src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o -MF
src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o.d -o src/_backend_agg.cpython-312-darwin.so.p/_backend_agg.cpp.o -c ../../src/_backend_agg.cpp
In file included from ../../src/_backend_agg.cpp:6:
../../src/_backend_agg.h:9:10: fatal error: 'pybind11/pybind11.h' file not found
9 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
[10/23] Compiling C++ object src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o
FAILED: src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o
c++ -Isrc/ft2font.cpython-312-darwin.so.p -Isrc -I../../src -I../../subprojects/freetype-2.6.1/include
-I../../extern/agg24-svn/include -I/Users/dstansby/.local/share/uv/python/cpython-3.12.8-macos-aarch64-none/include/python3.12
-I/Users/dstansby/.cache/uv/builds-v0/.tmp4X2jQO/lib/python3.12/site-packages/pybind11/include -I/install/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden
-flto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c++17 -O3 '-DFREETYPE_BUILD_TYPE="local"' -MD -MQ src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o -MF
src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o.d -o src/ft2font.cpython-312-darwin.so.p/ft2font.cpp.o -c ../../src/ft2font.cpp
In file included from ../../src/ft2font.cpp:13:
../../src/mplutils.h:54:10: fatal error: 'pybind11/pybind11.h' file not found
54 | #include <pybind11/pybind11.h>
| ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
hint: This usually indicates a problem with the package or the build environment.
DEBUG Released lock at `/Users/dstansby/software/matplotlib/.venv/.lock`
Expected outcome
A working install
Additional information
No response
Operating system
macOS
Matplotlib Version
Latest main branch
Matplotlib Backend
No response
Python version
Python 3.12.8
Jupyter version
No response
Installation
git checkout
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 acondaenvironment.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
mainbranchMatplotlib Backend
No response
Python version
Python 3.12.8
Jupyter version
No response
Installation
git checkout