# MLX: fix Cannot resolve imported module mlx.core

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/mlx-cannot-resolve-imported-module-mlx-core
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, upgrade MLX to restore the type stubs omitted from the 0.32.0 macOS arm64 wheels. This packaging issue affects static imports, while runtime imports are unaffected. Use `v0.32.4`.

**Not for:** MLX DLPackCompatible annotation mismatches when passing NumPy arrays.

Subjects: local-models, testing

Do first: Upgrade MLX to `v0.32.4` (as of November 2026).

## Symptom
``error[unresolved-import]: Cannot resolve imported module `mlx.core``` appears in downstream type checking with ty against the 0.32.0 macOS arm64 wheels. Reported by dgrauet. Other users commented in the issue, including [alec-bike](https://github.com/ml-explore/mlx/issues/3916#issuecomment-5283588291).

## Cause
The wheel-building process omitted the generated type stubs while retaining the typed-package marker. The merged refactor changes how frontend and backend files are selected for wheels; zcbenz's follow-up explicitly identifies the included stub fix.

## Fix
1. Upgrade MLX to `v0.32.4` (as of November 2026).
2. The release source explicitly copies the type stubs into the extension output and includes `*.pyi` in wheel package data. This addresses missing stubs rather than changing runtime import behavior.

The `v0.32.4` build script still copies the stubs and includes `*.pyi` as package data. [Release source](https://github.com/ml-explore/mlx/blob/v0.32.4/setup.py).

## Fixed in
First stable carrying release: `v0.32.1` (released 2026-08-18). PR #3818 merged 2026-08-17.

## If it still fails
- Restoring missing stubs does not promise that every annotation is correct. The issue concerns the 0.32.0 macOS arm64 wheels; it does not establish that every unresolved import has this cause.

Not for: MLX DLPackCompatible annotation mismatches when passing NumPy arrays.

## Sources
- [[BUG] 0.32.0 wheels ship py.typed but no .pyi stubs — breaks type checking of mlx.core downstream](https://github.com/ml-explore/mlx/issues/3916), dgrauet, opened 2026-07-25; closed as completed on 2026-08-17: "Runtime is completely unaffected"
- [Refactor wheel building script](https://github.com/ml-explore/mlx/pull/3818), zcbenz; merged 2026-08-17 (closed).
- [v0.32.1](https://github.com/ml-explore/mlx/releases/tag/v0.32.1), published 2026-08-18.
- [Issue comment](https://github.com/ml-explore/mlx/issues/3916#issuecomment-5283588291), alec-bike, 2026-08-13; parent issue closed as completed on 2026-08-17.
- [Issue comment](https://github.com/ml-explore/mlx/issues/3916#issuecomment-5300731171), zcbenz, 2026-08-15; parent issue closed as completed on 2026-08-17.
- [v0.32.4 release](https://github.com/ml-explore/mlx/releases/tag/v0.32.4), published 2026-10-14.
- [Release source](https://github.com/ml-explore/mlx/blob/v0.32.4/setup.py), read at `v0.32.4`.

## Checked
2026-11-24; read the issue and comments API records, merged PR record and changed-file diff, first carrying release record, and the v0.32.4 release and source; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.