Ask Your Question

ImportError: No module named 'sage'

asked 2016-08-10 17:00:51 -0600

k1monfared gravatar image

updated 2016-08-11 05:25:10 -0600

slelievre gravatar image

I had a Sage 6.5 installed from the repository, running on my Fedora 22 nicely. But today when I went to run it I get the following error:

│ Sage Version 6.5, Release Date: 2015-02-17                         │
│ Type "notebook()" for the browser-based notebook interface.        │
│ Type "help()" for help.                                            │
Traceback (most recent call last):
  File "/usr/lib64/sagemath/local/bin/sage-ipython", line 6, in <module>
    from sage.repl.interpreter import SageTerminalApp
ImportError: No module named 'sage'

I reinstalled Sage, but I still get the same error. Any ideas on why do I get this error and how to resolve it?

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2016-08-11 05:26:00 -0600

slelievre gravatar image
edit flag offensive delete link more


Yes, that does it. Anaconda had added a path to my bashrc. After deleting it sage started working. Thanks.

k1monfared gravatar imagek1monfared ( 2016-08-11 11:28:19 -0600 )edit

This solutions gets sage working for me, but then Anaconda doesn't work. What can I do to have them both working?

ttshaw1 gravatar imagettshaw1 ( 2018-10-06 17:28:03 -0600 )edit

put that one like into a file, and source it every time you want to start anaconda. (Better, make a script that sources this line and starts Anaconda for you).

Dima gravatar imageDima ( 2018-12-17 23:09:09 -0600 )edit

answered 2016-08-11 11:29:49 -0600

k1monfared gravatar image

As slelievre pointed it out there was a path added to my .bashrc file after installing anaconda. After removing that line sage started working.

edit flag offensive delete link more



What line should I remove? And, I can't find this file. Is it the same as .bash_profile?

roi.holtzman gravatar imageroi.holtzman ( 2016-10-24 03:34:45 -0600 )edit

@k1monfared do you know what should I do if I don't see this file?

roi.holtzman gravatar imageroi.holtzman ( 2016-11-11 02:37:57 -0600 )edit

@roi.holtzman yes, I believe they are the same. Here is a more in depth explanation:

k1monfared gravatar imagek1monfared ( 2016-11-22 15:25:04 -0600 )edit

answered 2019-05-17 12:44:50 -0600

frankc gravatar image

For those asking how to run sage if you have anaconda in your path, you can do something like (in bash):

eval PATH=$(echo $PATH | sed -r 's|([:/])[^:]*anaconda3?/bin:|\1|g') sage
edit flag offensive delete link more


It doesn't work for me, I get an error with missing packages even though before installing anaconda sage worked without problems

Dominik Stępień gravatar imageDominik Stępień ( 2020-06-10 07:33:18 -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: 2016-08-10 17:00:51 -0600

Seen: 6,775 times

Last updated: May 17 '19