Simon King
unread,Apr 15, 2018, 10:11:06 AM4/15/18Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sage-s...@googlegroups.com
Hi!
The following cython code compiles fine in SageMath command line version
and it *used* to compile fine in the jupyter notebook one year ago:
cython("""
def mantisse():
cdef double a = 1
cdef double b = 2
cdef int i = 0
while True:
a += b**(-i)
print("%2d: %.53f"%(i,a))
if a==1:
return i-1
i += 1
a = 1
""")
However, in the jupyter notebook I no get the error
RuntimeError Traceback (most recent call last)
<ipython-input-3-672ba140476c> in <module>()
12 i += 1
13 a = 1
---> 14 """)
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/lazy_import.pyx in sage.misc.lazy_import.LazyImport.__call__ (build/cythonized/sage/misc/lazy_import.c:3756)()
352 True
353 """
--> 354 return self.get_object()(*args, **kwds)
355
356 def __repr__(self):
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cython.pyc in cython_compile(code, **kwds)
1005 with open(tmpfile,'w') as f:
1006 f.write(code)
-> 1007 return cython_import_all(tmpfile, get_globals(), **kwds)
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cython.pyc in cython_import_all(filename, globals, **kwds)
895 code
896 """
--> 897 m = cython_import(filename, **kwds)
898 for k, x in iteritems(m.__dict__):
899 if k[0] != '_':
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cython.pyc in cython_import(filename, **kwds)
870 - the module that contains the compiled Cython code.
871 """
--> 872 name, build_dir = cython(filename, **kwds)
873
874 oldpath = sys.path
/home/king/Sage/git/sage/local/lib/python2.7/site-packages/sage/misc/cython.pyc in cython(filename, verbose, compile_message, use_cache, create_local_c_file, annotate, sage_namespace, create_local_so_file)
669 except Exception as msg:
670 msg = str(msg) + "\n" + distutils_messages
--> 671 raise RuntimeError(msg.strip())
672
673 if verbose >= 0:
RuntimeError: fileno
What goes wrong?
I'd like to have it solved till the day after tomorrow, as the notebook
is to be used in some exercise group.
Best regards,
Simon