Ask Your Question
0

Sagemath does not open anymore

asked 2018-09-14 18:54:56 +0100

tomcho gravatar image

updated 2018-10-08 00:40:39 +0100

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/interpreter.py", line 109, in <module>                                                                                   
    from sage.repl.prompts import SagePrompts, InterfacePrompts
  File "/usr/lib/python2.7/site-packages/sage/repl/prompts.py", line 16, in <module>
    from IPython.terminal.prompts import Prompts
  File "/usr/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
    from .core.application import Application
  File "/usr/lib/python2.7/site-packages/IPython/core/application.py", line 23, in <module>                                                                                 
    from traitlets.config.application import Application, catch_config_error
  File "/usr/lib/python2.7/site-packages/traitlets/__init__.py", line 1, in <module>
    from .traitlets import *
  File "/usr/lib/python2.7/site-packages/traitlets/traitlets.py", line 60, in <module>                                                                                      
    from .utils.importstring import import_item
  File "/usr/lib/python2.7/site-packages/traitlets/utils/importstring.py", 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

Comments

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 19:45:38 +0100 )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-15 01:24:59 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-09-16 10:26:44 +0100

vdelecroix gravatar image

updated 2018-09-16 14:00:13 +0100

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 https://ipython.org/ipython-doc/2/dev... the function cast_bytes has to be found in IPython.utils.py3compat and not in ipython_genutils.py3compat.

edit flag offensive delete link more

Comments

1

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 16:21:31 +0100 )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

Stats

Asked: 2018-09-14 18:54:56 +0100

Seen: 726 times

Last updated: Sep 16 '18