AttributeError: module 'sage.sandpiles.all' has no attribute 'absolute_import'

29 views
Skip to first unread message

jonatha...@googlemail.com

unread,
Feb 9, 2021, 8:56:30 AM2/9/21
to sage-devel

Dear all,

sage crashes once in a while hard with some strange error.

Does anyone know what is going on? This is somewhat new. Not reproducible.

Happened to me maybe 3 or 4 times now at various occasions.

Jonathan
Sage_crash_report.txt

Dima Pasechnik

unread,
Feb 9, 2021, 9:52:51 AM2/9/21
to sage-devel
it looks like https://github.com/davidhalter/jedi/issues/1615
and our version of jedi is older than the fix there.
Upgrade jedi (if this is possible without a full ipython/jupyter
upgrade, don't know) ?
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/53367a09-45ff-4ebf-bcca-88766b0b77e9n%40googlegroups.com.

Matthias Koeppe

unread,
Feb 9, 2021, 11:56:31 AM2/9/21
to sage-devel
A Jupyter upgrade is in https://trac.sagemath.org/ticket/31280 - which needs some help

jonatha...@googlemail.com

unread,
Feb 9, 2021, 3:05:20 PM2/9/21
to sage-devel
Actually the error is reproducible:

    def foo(): return 2
    foo()
    foo()

What makes it crash is hitting TAB after opening the parenthesis and then completing it and hitting enter.

jonatha...@googlemail.com

unread,
Feb 9, 2021, 3:10:49 PM2/9/21
to sage-devel
The jedi upgrade (to 0.18.0) does not fix the error, but does change the log:
Sage_crash_report.txt

jonatha...@googlemail.com

unread,
Feb 9, 2021, 3:23:54 PM2/9/21
to sage-devel
Downgrading to jedi 0.15, I instead get the error (after long wait time)

/usr/lib/python3.7/inspect.py:718: DeprecationWarning: sage.interacts.debugger is deprecated because it is meant for the deprecated Sage Notebook
See https://trac.sagemath.org/27531 for details.
  if hasattr(object, '__module__'):

All rather strange to me. To be clear. I'm not using jupyter, I'm just on the shell.

Dima Pasechnik

unread,
Feb 9, 2021, 5:44:26 PM2/9/21
to sage-devel
an isolated upgrade to 0.18 probably won't fly.

And indeed, jedi is used in ipython, not only in jupyter. Perhaps one
can update only ipython, and leave jupyter for later?
I don't know.



On Tue, Feb 9, 2021 at 8:23 PM 'jonatha...@googlemail.com' via
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/d4e347a9-ead5-401e-906b-7159ebd2679fn%40googlegroups.com.

Jonathan Kliem

unread,
Feb 10, 2021, 3:15:44 AM2/10/21
to sage-...@googlegroups.com
A ipython upgrade solves this (somewhat). Jedi upgrade makes the
traceback a bit nicer then.

After upgrading I still get an error message, but the sessions recovers
itself.

Upgrading ipython and jedi is subject to
https://trac.sagemath.org/ticket/31373#comment:1

Here is the remaining traceback, still strange, but only a bit annoying,
as at least the session is kept active:

Traceback (most recent call last):
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/cache.py",
line 110, in wrapper
    return dct[key]
KeyError: (('get_signature_params',), frozenset())

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/IPython/terminal/ptutils.py",
line 115, in get_completions
    yield from self._get_completions(body, offset, cursor_position,
self.ipy_completer)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/IPython/terminal/ptutils.py",
line 131, in _get_completions
    for c in completions:
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/IPython/core/completer.py",
line 438, in _deduplicate_completions
    completions = list(completions)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/IPython/core/completer.py",
line 1827, in completions
    for c in self._completions(text, offset,
_timeout=self.jedi_compute_type_timeout/1000):
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/IPython/core/completer.py",
line 1884, in _completions
    signature = _make_signature(jm)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/IPython/core/completer.py",
line 998, in _make_signature
    return '('+c0.to_string().split('(', maxsplit=1)[1]
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/api/classes.py",
line 814, in to_string
    return self._signature.to_string()
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/signature.py",
line 31, in to_string
    s = self.name.string_name + '(' + ', '.join(param_strings()) + ')'
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/signature.py",
line 13, in param_strings
    for n in self.get_param_names(resolve_stars=True):
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/signature.py",
line 52, in get_param_names
    param_names = self._function_value.get_param_names()
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/utils.py",
line 16, in wrapper
    return list(func(*args, **kwargs))
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/compiled/value.py",
line 121, in get_param_names
    signature_params = self.access_handle.get_signature_params()
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/compiled/subprocess/__init__.py",
line 386, in _workaround
    return self._cached_results(name, *args, **kwargs)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/cache.py",
line 112, in wrapper
    result = method(self, *args, **kwargs)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/compiled/subprocess/__init__.py",
line 390, in _cached_results
    return self._subprocess.get_compiled_method_return(self.id, name,
*args, **kwargs)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/compiled/subprocess/functions.py",
line 27, in get_compiled_method_return
    return getattr(handle.access, attribute)(*args, **kwargs)
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/compiled/access.py",
line 482, in get_signature_params
    ) for p in self._get_signature().parameters.values()
  File
"/srv/public/kliem/sage/local/lib/python3.7/site-packages/jedi/inference/compiled/access.py",
line 488, in _get_signature
    return inspect.signature(obj)
  File "/usr/lib/python3.7/inspect.py", line 3083, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
  File "/usr/lib/python3.7/inspect.py", line 2833, in from_callable
    follow_wrapper_chains=follow_wrapped)
  File "/usr/lib/python3.7/inspect.py", line 2288, in
_signature_from_callable
    skip_bound_arg=skip_bound_arg)
  File "/usr/lib/python3.7/inspect.py", line 2112, in
_signature_from_builtin
    raise ValueError("no signature found for builtin {!r}".format(func))
  File "sage/misc/lazy_import.pyx", line 375, in
sage.misc.lazy_import.LazyImport.__repr__
(build/cythonized/sage/misc/lazy_import.c:4134)
    obj = self.get_object()
  File "sage/misc/lazy_import.pyx", line 190, in
sage.misc.lazy_import.LazyImport.get_object
(build/cythonized/sage/misc/lazy_import.c:2436)
    return self._get_object()
  File "sage/misc/lazy_import.pyx", line 223, in
sage.misc.lazy_import.LazyImport._get_object
(build/cythonized/sage/misc/lazy_import.c:2715)
    self._object = getattr(__import__(self._module, {}, {},
[self._name]), self._name)
AttributeError: module 'sage.sandpiles.all' has no attribute
'absolute_import'

Unhandled exception in event loop:

Exception None
Press ENTER to continue...
Reply all
Reply to author
Forward
0 new messages