Ask Your Question

tuna's profile - activity

2021-02-01 12:44:25 +0200 received badge  Famous Question (source)
2020-10-25 07:35:57 +0200 received badge  Good Question (source)
2020-06-15 12:05:09 +0200 received badge  Notable Question (source)
2020-06-15 12:05:09 +0200 received badge  Popular Question (source)
2018-05-07 20:09:56 +0200 received badge  Nice Question (source)
2018-05-07 07:31:47 +0200 received badge  Student (source)
2018-05-07 07:30:32 +0200 asked a question Importing Sage functions into Cython?

I am trying to define variables in Cython part of my code like this

a,b,c = var('a,b,c')

But in this line I cant import var() function from Sage

from sage.calculus.var import var

I got this error:

$ sage -python  real_sage.sage
Compiling ./real_sage.spyx...
Traceback (most recent call last):
  File "real_sage.sage", line 6, in <module>
    from real_sage import foo
  File "real_sage.pyx", line 10, in init real_sage
  File "sage/calculus/var.pyx", line 6, in init sage.calculus.var
  File "/home/tunamustafakemal/sega/SageMath/local/lib/python2.7/site-packages/sage/symbolic/function_factory.py", line 15, in <module>
    from sage.symbolic.function import SymbolicFunction, sfunctions_funcs, \
  File "sage/rings/integer.pxd", line 7, in init sage.symbolic.function
  File "sage/rings/rational.pxd", line 8, in init sage.rings.integer
  File "sage/rings/rational.pyx", line 89, in init sage.rings.rational
  File "sage/rings/real_mpfr.pyx", line 1, in init sage.rings.real_mpfr
  File "sage/rings/complex_number.pxd", line 6, in init sage.libs.mpmath.utils
  File "sage/rings/complex_double.pxd", line 10, in init sage.rings.complex_number
  File "sage/rings/complex_double.pyx", line 94, in init sage.rings.complex_double
ImportError: cannot import name complex_number

Thanks for any support.