Skip to content

Relax numpy pin to support Python 3.12+#2718

Open
Chessing234 wants to merge 1 commit into
d2l-ai:masterfrom
Chessing234:fix/numpy-python312
Open

Relax numpy pin to support Python 3.12+#2718
Chessing234 wants to merge 1 commit into
d2l-ai:masterfrom
Chessing234:fix/numpy-python312

Conversation

@Chessing234

Copy link
Copy Markdown

Summary

  • Change numpy==1.23.5 to numpy>=1.26.0,<2.0 in setup.py
  • numpy 1.23.5 depends on distutils, which was removed from the Python 3.12+ standard library (PEP 632)
  • numpy 1.26+ builds without distutils and remains compatible with the pinned scipy==1.10.1

Test plan

  • pip install -e . succeeds on Python 3.12+
  • Existing notebook code using numpy/scipy still runs

Fixes #2678

Made with Cursor

numpy 1.23.5 depends on distutils, which was removed in Python 3.12.
Use numpy>=1.26.0,<2.0 to stay compatible with scipy 1.10.1.

Fixes d2l-ai#2678.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade numpy (v1.23.5) to prevent depricated distutils error in Python 3.12+

1 participant