Hello. I am currently embedding SageMath within a C++ program. Executing it 
gives the expected output, but afterwards I get the following error:

File "/home/username/Documents/my-module.py", line 1, in <module> from 
sage.all import * File "/home/username/sage/src/sage/all.py", line 62, in 
<module> from sage.all__sagemath_repl import * # includes 
.all__sagemath_objects, .all__sagemath_environment File 
"/home/username/sage/src/sage/all__sagemath_repl.py", line 109, in <module> 
from sage.all__sagemath_objects import * File 
"/home/username/sage/src/sage/all__sagemath_objects.py", line 12, in 
<module> from cysignals.signals import (AlarmInterrupt, SignalError, File 
"/home/username/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/cysignals/__init__.py",
 
line 3, in <module> init_cysignals()


Why is this occurring? Any help would be much appreciated.

My C++ code embedding Python:
Py_Initialize(); PyObject* pModule = PyImport_ImportModule("my-module"); if(
pModule) { PyObject* pFunc = PyObject_GetAttrString(pModule, "test"); if (pFunc 
&& PyCallable_Check(pFunc)) PyObject_CallNoArgs(pFunc); } Py_Finalize();

My Python code in my-module.py:
from sage.all import * def test(): F = FunctionField(GF(Integer(2**16)), 
names=('x')) x = F.gen() places = F.places() D = places[0] + places[1] + 
places[2] + places[3] + places[4] + places[5] + places[6] print(D.
basis_function_space())
I am running this on Ubuntu 22.04 in VirtualBox 7.0.14. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/fbb3f1ca-bcae-41f8-8b7b-eb8962c8a1dan%40googlegroups.com.

Reply via email to