Skip to content

Error finding "ninja" when setting up development environment #29739

@dstansby

Description

@dstansby

Following the instructions in https://matplotlib.org/devdocs/devel/development_setup.html#create-local-environment (but using uv to manage the virtual environment), I end up with the following error:

% 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/.tmp3JxhbI", {}, None)`
DEBUG 
DEBUG meson-python: error: Could not find ninja version 1.8.2 or newer.
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-python: error: Could not find ninja version 1.8.2 or newer.

      hint: This usually indicates a problem with the package or the build
      environment.
DEBUG Released lock at `/Users/dstansby/software/matplotlib/.venv/.lock`

Adding ninja>=1.8.2 to the build requirements file seems to fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions