Ask Your Question

Sagemath does not open anymore

asked 2018-09-14 11:54:56 -0600

tomcho gravatar image

updated 2018-10-07 17:40:39 -0600

tmonteil gravatar image

I was trying to install sagemath-jupyter on my Arch Linux (which turned out to be a near impossible task) and deleted a bunch of packages from pip2. Now I can't even open sagemath, even after re-installing sagemath from Pacman:

Traceback (most recent call last):
  File "/usr/bin/sage-ipython", line 12, in <module>
    from sage.repl.interpreter import SageTerminalApp
  File "/usr/lib/python2.7/site-packages/sage/repl/", line 109, in <module>                                                                                   
    from sage.repl.prompts import SagePrompts, InterfacePrompts
  File "/usr/lib/python2.7/site-packages/sage/repl/", line 16, in <module>
    from IPython.terminal.prompts import Prompts
  File "/usr/lib/python2.7/site-packages/IPython/", line 48, in <module>
    from .core.application import Application
  File "/usr/lib/python2.7/site-packages/IPython/core/", line 23, in <module>                                                                                 
    from traitlets.config.application import Application, catch_config_error
  File "/usr/lib/python2.7/site-packages/traitlets/", line 1, in <module>
    from .traitlets import *
  File "/usr/lib/python2.7/site-packages/traitlets/", line 60, in <module>                                                                                      
    from .utils.importstring import import_item
  File "/usr/lib/python2.7/site-packages/traitlets/utils/", line 8, in <module>                                                                              
    from ipython_genutils.py3compat import cast_bytes_py2
ImportError: No module named ipython_genutils.py3compat

Any ideas on how to overcome this? (And preferably also installing sagemath-jupyter?

I have installed ipython_genutils with pip2 already (version 0.1.0).

edit retag flag offensive close merge delete


You should be much more specific about. We need to know at least your operating system, which method you used to install sagemath. And possibly, what have you done recently that might have break Sage.

vdelecroix gravatar imagevdelecroix ( 2018-09-14 12:45:38 -0600 )edit

@vdelecroix I don't think I can be much more specific. My OS is Arch Linux (which is already mentioned), I installed Sagemath via pacman and what I did to break it was to try to uninstall every package that was installed via pip2. (I did this last thing because when trying to install sagemath-jupyter, pacman failed with a bunch of conflicted packages that were installed via pip2.)

tomcho gravatar imagetomcho ( 2018-09-14 18:24:59 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-09-16 03:26:44 -0600

vdelecroix gravatar image

updated 2018-09-16 07:00:13 -0600

You should not mix system installed packages (via pacman) and self installed packages (via pip2). I would advice you to remove one by one the packages you installed via pip2 (you can obtain the list of them using "pip2 list"). If you really need to install packages with pip2 it is much better to install them in your home directory with the --user option of pip2. It should not often be the case are the packages in ArchLinux are very often available in their latest version.

More specifically related to your problem, you should check how traitlets was installed. As can be read at the function cast_bytes has to be found in IPython.utils.py3compat and not in ipython_genutils.py3compat.

edit flag offensive delete link more



it is much better to install them in your home directory with the --user option of pip2

Or using a virtualenv

Iguananaut gravatar imageIguananaut ( 2018-09-19 09:21:31 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-09-14 11:54:56 -0600

Seen: 72 times

Last updated: Sep 16