Ask Your Question
1

ImportError: No module named 'sage'

asked 2016-08-11 00:00:51 +0100

k1monfared gravatar image

updated 2016-08-11 12:25:10 +0100

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
┌────────────────────────────────────────────────────────────────────┐
│ 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
1

answered 2016-08-11 12:26:00 +0100

slelievre gravatar image
edit flag offensive delete link more

Comments

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 18:28:19 +0100 )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-07 00:28:03 +0100 )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-18 06:09:09 +0100 )edit
1

answered 2016-08-11 18:29:49 +0100

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

Comments

1

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 10:34:45 +0100 )edit

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

roi.holtzman gravatar imageroi.holtzman ( 2016-11-11 09:37:57 +0100 )edit

@roi.holtzman yes, I believe they are the same. Here is a more in depth explanation: http://www.joshstaiger.org/archives/2...

k1monfared gravatar imagek1monfared ( 2016-11-22 22:25:04 +0100 )edit
0

answered 2019-05-17 19:44:50 +0100

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

Comments

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 14:33:18 +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: 2016-08-11 00:00:51 +0100

Seen: 13,831 times

Last updated: May 17 '19