Skip to content
Latchkey

Python "ImportError: numpy built from source (no wheel for 3.13)" in CI

When no prebuilt numpy wheel exists for the running Python (a brand-new release like 3.13 shortly after launch), pip builds numpy from source. That requires a C/Fortran toolchain and meson; on a minimal runner it fails before producing an importable module.

What this error means

pip logs "Building wheel for numpy (pyproject.toml) ... error" on Python 3.13, or import fails with a numpy build/ABI error after a source build.

pip
Building wheel for numpy (pyproject.toml) did not run successfully.
  ...
  meson.build:1:0: ERROR: Unknown compiler(s)

Common causes

No matching wheel for the Python version

numpy has not yet published a wheel for the just-released interpreter, so pip builds from source.

The source build toolchain is missing

The runner lacks a C/Fortran compiler or meson, so the from-source build fails.

How to fix it

Use a Python version with wheels, or provide the toolchain

  1. Pin CI to a Python version numpy publishes wheels for, or pin a numpy version that has a wheel for your interpreter.
  2. If a source build is unavoidable, install a compiler toolchain and meson/ninja first.
  3. Prefer the latest numpy that ships wheels for your target Python.
Terminal
python -m pip install --only-binary=:all: "numpy>=1.26,<3"

How to prevent it

  • Latchkey managed runners auto-retry transient install failures and ship a full build toolchain, so a source build that needs a compiler does not fail for a missing dependency.
  • Pin Python to versions with published numpy wheels.
  • Use --only-binary to fail fast instead of building from source.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →