After (routine) upgrade of Python in Debian testing, command-line Sage crashes at startup

25 views
Skip to first unread message

Emmanuel Charpentier

unread,
Nov 10, 2021, 4:35:54 AM11/10/21
to sage-support

A routine upgrade of Debian testing (where a few Python binaries were upgraded, broke a formerly functional (command line) Sage. It now crashes at startup :

charpent@p-202-021:~$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.5.beta2, Release Date: 2021-09-26               │
│ Using Python 3.9.8. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Traceback (most recent call last):
  File "/usr/local/sage-9/src/bin/sage-ipython", line 15, in <module>
    app.initialize()
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/IPython/terminal/ipapp.py", line 308, in initialize
    super(TerminalIPythonApp, self).initialize(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/IPython/core/application.py", line 450, in initialize
    self.parse_command_line(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/IPython/terminal/ipapp.py", line 303, in parse_command_line
    return super(TerminalIPythonApp, self).parse_command_line(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 88, in inner
    return method(app, *args, **kwargs)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/application.py", line 709, in parse_command_line
    self.cli_config = deepcopy(loader.load_config())
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 851, in load_config
    self._parse_args(argv)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 908, in _parse_args
    self.parsed_data = self.parser.parse_args(to_parse)
  File "/usr/lib/python3.9/argparse.py", line 1834, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 768, in parse_known_args
    return super().parse_known_args(args, namespace)
  File "/usr/lib/python3.9/argparse.py", line 1862, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python3.9/argparse.py", line 2076, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/python3.9/argparse.py", line 2016, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/python3.9/argparse.py", line 1944, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/local/sage-9/local/lib/python3.9/site-packages/traitlets/config/loader.py", line 933, in __call__
    namespace._flags.append(self.flag)
AttributeError: 'Namespace' object has no attribute '_flags'

Rebuilding Sage (make build) was unsuccessful.

However, using Sage via the Jupyter notebook still works.

Suggestions ?

Dima Pasechnik

unread,
Nov 10, 2021, 4:41:59 AM11/10/21
to sage-support
it might be that you have to rebuild all the cython/python packages of Sage.

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/466b03f5-9341-476e-977d-259c6d3e822dn%40googlegroups.com.

Emmanuel Charpentier

unread,
Nov 10, 2021, 4:45:32 AM11/10/21
to sage-support
Le mercredi 10 novembre 2021 à 10:41:59 UTC+1, dim...@gmail.com a écrit :
it might be that you have to rebuild all the cython/python packages of Sage.
 
That amounts to rebuilding from scratch, no ?

Dima Pasechnik

unread,
Nov 10, 2021, 4:49:28 AM11/10/21
to sage-support


On Wed, 10 Nov 2021, 09:45 Emmanuel Charpentier, <emanuel.c...@gmail.com> wrote:


Le mercredi 10 novembre 2021 à 10:41:59 UTC+1, dim...@gmail.com a écrit :
it might be that you have to rebuild all the cython/python packages of Sage.
 
That amounts to rebuilding from scratch, no ?

not everything depends on python in Sage, e.g. GAP does not.

at the very minimum, do

make sagelib-clean
followed by
make build

it's hard to say which of the gazzion of the other python spkgs is affected


Emmanuel Charpentier

unread,
Nov 10, 2021, 6:22:03 AM11/10/21
to sage-support

Le mercredi 10 novembre 2021 à 10:49:28 UTC+1, dim…@gmail.com a écrit :



On Wed, 10 Nov 2021, 09:45 Emmanuel Charpentier, <emanuel.c...@gmail.com> wrote:


Le mercredi 10 novembre 2021 à 10:41:59 UTC+1, dim...@gmail.com a écrit :
it might be that you have to rebuild all the cython/python packages of Sage.
 
That amounts to rebuilding from scratch, no ?

not everything depends on python in Sage, e.g. GAP does not.

at the very minimum, do

make sagelib-clean
followed by
make build

No such luck : this crashes again. Grrr…

The trace points to something called traitlets. Seems specific to interactive command-line use (sage -optional still parses its arguments and runs okay.).

Attempting rebuilding from scratch…

Jan Groenewald

unread,
Nov 10, 2021, 6:31:06 AM11/10/21
to sage-support
Maybe sage -f ipython will fix it?




--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^ 

Emmanuel Charpentier

unread,
Nov 10, 2021, 12:41:40 PM11/10/21
to sage-support

So far :

  • Rebuild from scratch : sage command line crashes (same problem)

  • After sage -f ipython : ditto.

In both cases, the sagemath Jupyter kernel works in both the Jupyter notebook and Jupyter lab

sage -i <SomeSagePackage> also works.

Worth a ticket…, whose priority I’m uncertain about.

Obvious workaround : ./configure --with-system-python3=no && make

HTH,

Dima Pasechnik

unread,
Nov 10, 2021, 1:35:20 PM11/10/21
to sage-support
On Wed, Nov 10, 2021 at 5:41 PM Emmanuel Charpentier <emanuel.c...@gmail.com> wrote:

So far :

  • Rebuild from scratch : sage command line crashes (same problem)

Wait, what's this new system Python? Is it not a 3.10 by any chance?
In more detail, from which to which versions did you upgrade?

 

Emmanuel Charpentier

unread,
Nov 10, 2021, 2:06:54 PM11/10/21
to sage-support

As reported in the ticket :

charpent@zen-book-flip:~$ python --version
Python 3.9.8

HTH,

Emmanuel Charpentier

unread,
Nov 10, 2021, 10:15:20 PM11/10/21
to sage-support
FWIW, I just positively reviewed the Mathias Koeppe's solution to the ticket.

HTH,

Reply all
Reply to author
Forward
0 new messages