Cython + numpy broken in Sage >= 10.8

28 views
Skip to first unread message

Eric Gourgoulhon

unread,
Feb 4, 2026, 9:14:38 AM (20 hours ago) Feb 4
to sage-devel
Hi, 

The demo notebook
used to work well up to Sage 10.7 (included). 
In Sage 10.8 and 10.9.beta5, it fails in cell 65 with the error message:

RuntimeError: command '/usr/bin/gcc' failed with exit code 1 /tmp/sage_3h57taol/spyx_bq4f9ism/_tmp_sage_3h57taol_tmp_c0x04if5_pyx/_tmp_sage_3h57taol_tmp_c0x04if5_pyx_0.c:1158:10: fatal error: numpy/arrayobject.h: Aucun fichier ou dossier de ce nom 1158 | #include "numpy/arrayobject.h"

This cell combines cython and numpy. 
My system is Ubuntu 24.04 and numpy is from Sage spkg since there is no system numpy installed on that computer. 

Following this thread
a workaround was to run
sudo ln -s /home/eric/sage/10.9/local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/numpy/_core/include/numpy/ /usr/include/numpy

Then the notebook ran successfully. 
So it seems that in the cython cell 65, the header files for numpy were searched in /usr/include/numpy (which did not exist), instead of in local/var/lib/sage/venv-python3.12.5/lib/python3.12/site-packages/numpy/_core/include/numpy/ under the Sage root directory. 

I've just checked that on the same computer, there is no such an issue with Sage 10.7. 

Eric. 
Reply all
Reply to author
Forward
0 new messages