Skip to content

Commit b3e7c9c

Browse files
Mayank PandeyCopilot
andcommitted
fix: Pin NumPy < 2.0 to fix macOS ARM backend crash
- Pin numpy<2.0 in requirements.txt to avoid NumPy 2.x breaking changes - Add NumPy hidden imports to backend_server.spec for PyInstaller compatibility - Fix requirements.txt encoding (UTF-16 → UTF-8) Fixes: Backend crashes with 'ModuleNotFoundError: No module named numpy._core._exceptions' on macOS Apple Silicon (M1/M2/M3/M4) due to NumPy 2.x internal module restructuring that PyInstaller doesn't properly bundle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2fb67ca commit b3e7c9c

7 files changed

Lines changed: 302 additions & 179 deletions

File tree

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,14 @@ backend_server-x86_64-unknown-linux-gnu
226226
backend_server-aarch64-unknown-linux-gnu
227227
backend_server-aarch64-apple-darwin
228228
backend_server-x86_64-apple-darwin
229-
backend_server-i686-unknown-linux-gnu
229+
backend_server-i686-unknown-linux-gnu
230+
231+
# Keep only the placeholder in the source-controlled backend bundle directory.
232+
/frontend/src-tauri/backend_server_bundle/*
233+
!/frontend/src-tauri/backend_server_bundle/.gitkeep
234+
235+
# Ignore generated package metadata/data files from bundled Python environments.
236+
**/*.dist-info/
237+
**/RECORD
238+
**/METADATA
239+
**/rg_cities1000.csv

backend/backend_server.spec

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ a = Analysis(
3333
'multiprocessing.synchronize',
3434
'multiprocessing.resource_tracker',
3535
'_multiprocessing',
36+
# NumPy hidden imports for PyInstaller compatibility
37+
'numpy._core._exceptions',
38+
'numpy._core._methods',
39+
'numpy._core._dtype_ctypes',
40+
'numpy._core._internal',
41+
'numpy._core.multiarray',
3642
],
3743
hookspath=[],
3844
hooksconfig={},

backend/requirements.txt

-849 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)