Ask Your Question
1

ImportError: No module named 'sage'

asked 8 years ago

k1monfared gravatar image

updated 8 years ago

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?

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
1

answered 8 years ago

slelievre gravatar image
Preview: (hide)
link

Comments

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

k1monfared gravatar imagek1monfared ( 8 years ago )

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 ( 6 years ago )

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 ( 6 years ago )
1

answered 8 years ago

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.

Preview: (hide)
link

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 ( 8 years ago )

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

roi.holtzman gravatar imageroi.holtzman ( 8 years ago )

@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 ( 8 years ago )
0

answered 5 years ago

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
Preview: (hide)
link

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ń ( 4 years ago )

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: 8 years ago

Seen: 14,358 times

Last updated: May 17 '19