Skip to content

Conversation

Prigoistic
Copy link
Contributor

Python 3.13 on macOS ARM: NumPy fails to install (builds from source)

  • Symptom: make install on Python 3.13 tries to build numpy==2.0.x from source on macOS ARM and fails with C/C++ errors.
  • Status: Ragas CI currently targets Python 3.9–3.12; Python 3.13 is best-effort until upstream wheels are broadly available.

Workarounds:

  1. Recommended: use Python 3.12
uv python install 3.12
uv venv -p 3.12 .venv-3.12
source .venv-3.12/bin/activate
uv sync --group dev
make check
  1. Stay on Python 3.13 (best effort):
  • Minimal install first to avoid heavy transitive pins:
uv venv -p 3.13 .venv-3.13
source .venv-3.13/bin/activate
uv pip install -e ".[dev-minimal]"
make check
  • If you need extras, add gradually:
uv pip install "ragas[tracing,gdrive,ai-frameworks]"
  • Prefer a prebuilt NumPy wheel (if available):
uv pip install "numpy>=2.1" --only-binary=:all:

If the resolver still pins to 2.0.x via transitive deps, temporarily set numpy>=2.1 locally and re-run uv sync --group dev.

  1. Last resort: build NumPy locally
xcode-select --install
export SDKROOT="$(xcrun --sdk macosx --show-sdk-path)"
export CC=clang
uv pip install numpy

Safe alternate-venv tip:

  • Keep your project .venv untouched and use .venv-3.12 / .venv-3.13. Avoid make install in alt envs; prefer uv commands directly. make check respects the active env via uv run --active.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 15, 2025
Copy link
Contributor

@anistark anistark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @Prigoistic 🎉

It'd be better to pin numpy version in pyproject.toml: "numpy>=1.21.0,<3.0.0",

Rest, looks okay to go.

@Prigoistic
Copy link
Contributor Author

Pinned the version in the pyproject.toml file.

Please check if there any other changes needed before merging.
Cheers!

@anistark anistark merged commit 31bf2a8 into explodinggradients:main Oct 1, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants