NumPy "numpy.core.multiarray failed to import" in CI
A package tried to import NumPy's compiled core and it failed to load. The NumPy install is broken or partial, or a dependent was built against an incompatible NumPy, so its C core cannot initialize.
What this error means
An import fails with "ImportError: numpy.core.multiarray failed to import" or "Original error was: ... numpy.core._multiarray_umath", often surfacing through pandas, scipy, or cv2.
ImportError: numpy.core.multiarray failed to import
(auto-generated because you didn't call 'matplotlib.use()')Common causes
A broken or partial NumPy install
An interrupted install, a leftover stale NumPy, or a shadowing local file named numpy leaves the compiled core unloadable.
An ABI mismatch with a dependent
A dependent built against a different NumPy version cannot import the installed NumPy core, surfacing as the multiarray import failure.
How to fix it
Reinstall NumPy cleanly
Force a clean NumPy reinstall so its compiled core is whole.
pip install --force-reinstall --no-cache-dir numpyAlign NumPy with its dependents
- Confirm no local file or folder named
numpyshadows the package. - Pin NumPy and its binary dependents to a compatible set.
- Re-run an import smoke test to confirm the core loads.
python -c "import numpy; print(numpy.__version__)"How to prevent it
- Avoid local modules named like installed packages (numpy).
- Lock NumPy with its dependents to a compatible set.
- Clear the pip cache after an interrupted scientific-stack install.