Sage error from module `typing` and python 3.8

asked 2020-01-02 19:09:35 +0100

arty-hlr gravatar image

updated 2020-01-03 09:05:33 +0100

FrédéricC gravatar image

Hi,

I installed sage from sagemath-git on AUR with python 3.8, and I have this error upon launching sage:

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.0, Release Date: 2020-01-01                     │
│ Using Python 3.8.1. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
Traceback (most recent call last):
  File "/usr/bin/sage-ipython", line 12, in <module>
    from sage.repl.interpreter import SageTerminalApp
  File "/usr/lib/python3.8/site-packages/sage/repl/interpreter.py", line 106, in <module>
    from sage.repl.prompts import InterfacePrompts
  File "/usr/lib/python3.8/site-packages/sage/repl/prompts.py", line 16, in <module>
    from IPython.terminal.prompts import Prompts
  File "/usr/lib/python3.8/site-packages/IPython/__init__.py", line 56, in <module>
    from .terminal.embed import embed
  File "/usr/lib/python3.8/site-packages/IPython/terminal/embed.py", line 14, in <module>
    from IPython.core.magic import Magics, magics_class, line_magic
  File "/usr/lib/python3.8/site-packages/IPython/core/magic.py", line 22, in <module>
    from .inputtransformer2 import ESC_MAGIC, ESC_MAGIC2
  File "/usr/lib/python3.8/site-packages/IPython/core/inputtransformer2.py", line 16, in <module>
    from typing import List, Tuple, Union
  File "/usr/lib/python3.8/site-packages/typing.py", line 1357, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/usr/lib/python3.8/site-packages/typing.py", line 1005, in __new__
    self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'

Which seems to be a problem relative to the typing package, whose version is 3.7.4. I googled that _abc_registry issue and it seems to be an issue for python 3.7 as well, so not sure if it's specific to the fact that I have python 3.8 on my system. Uninstalling typing with pip just causes a segfault, even after rebuilding sage.

edit retag flag offensive close merge delete

Comments

typing is part of standard library from python3.6 installing it on python3.7 causes AttributeError: type object 'Callable' has no attribute '_abc_registry' refers #1457 and python/typing/issues/573

FrédéricC gravatar imageFrédéricC ( 2020-01-04 09:45:08 +0100 )edit

I've seen that, but it doesn't explain why sage segfaults if typing is not installed, nor what solution there could be.

arty-hlr gravatar imagearty-hlr ( 2020-01-04 10:47:59 +0100 )edit

Installig stuff from pip as root is always a bad idea and leads to issues like this. Please post the error you get after uninstalling typing.

arojas gravatar imagearojas ( 2020-01-05 07:53:44 +0100 )edit

I'm not exactly clear how you're installing Sage. Sage doesn't support Python 3.8 yet.

Iguananaut gravatar imageIguananaut ( 2020-01-07 16:21:41 +0100 )edit