2

I've just installed sage with the command:

sudo apt-get install sagemath

But every time I try to start sage, following error show up:

$ sage
Traceback (most recent call last):
File "/usr/share/sagemath/bin/sage-ipython", line 7, in module
from sage.repl.interpreter import SageTerminalApp
ImportError: No module named repl.interpreter

Python 2.7 is the default on my PC. I tried to change it to python3 from "/usr/share/sagemath/bin/sage-ipython". But that didn't solve the problem. So, I removed that change. I have Ipython is installed and pip install sage says that sage is already available in /home/anik/.local/lib/python2.7/site-packages. Finally I've located interpreter.py file in /usr/lib/python2.7/dist-packages/sage/repl. So it seems nothing is missing. So why ipython can't locate this file and launch sage? I'm out of my depth.

1 Answer 1

1

I've kind of cooked up a solution. The problem was, the python interpreter was unable to locate some files of the sage module. So first I had to figure out where python interpreter is looking for those files. To do that I started the python interpreter from the command line, imported the sage module and ran the command:

>>>sage.__file__

The output was: "/home/anik/.local/lib/python2.7/site-packages/sage/__init__.pyc"

But I noticed previously that all the files of the sage module were kept in "/usr/lib/python2.7/dist-packages/sage/". So I just copied the files from there to where sage module is found to be located.

Although I can start and work on sage now, this is somewhat quackery that I did. I think a better solution would be to change the path. But I dunno which file contains this path. It will be great if someone adds that bit of wisdom.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .