Ask Your Question
2

Cannot launch sage with options on OS X

asked 2014-09-15 06:39:14 +0100

Han gravatar image

updated 2015-01-13 22:33:31 +0100

FrédéricC gravatar image

I have Sage 6.3 installed on OS X 10.9. I can launch Sage without any problem. However, when I tried to launch Sage with options in terminal, it always launchs Sage notebook in safari. For example, if I type $ sage -v, Sage notebook opens; if I type $ sage -ipython notebook, Sage notebook opens again. What should I do to solve this problem? I'm new to sage and python, so forgive me for my ignorance。

edit retag flag offensive close merge delete

Comments

Maybe you have an alias such as `alias sage='sage -notebook'` or `alias sage='open -a /Applications/Sage-6.3-OSX-64bit-10.9.app'`. More details in my answer.

slelievre gravatar imageslelievre ( 2014-09-15 09:54:45 +0100 )edit

Thanks to your suggestions. My problem is well solved.

Han gravatar imageHan ( 2014-09-15 15:50:28 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2014-09-15 09:52:20 +0100

slelievre gravatar image

Calling the sage executable in a Mac OS X terminal

Sage for Mac OS X: app vs non-app version

On OS X there are several ways to install Sage: download the app, or the non-app binary, or build from source.

In any case, you can call the command-line version of Sage by typing the full path to it in the terminal. This could be (adapt the path to reflect where you installed Sage, and the name of the app):

  • for the non-app version:

    $ /Applications/sage-6.3/sage
    
  • for the app version (the executable is hidden inside the .app bundle):

    /Applications/Sage-6.3-OSX-64bit-10.9.app/Contents/Resources/sage/sage
    

You can add options such as -v or -ipython notebook to such a call.

Typing 'sage' in the terminal

What happens when you type 'sage' in the terminal depends on whether an alias 'sage' exists, and what it points to, and whether 'sage' can be found in your PATH, and what this 'sage' is (an executable, a symlink...).

Type alias sage to check if you have an alias called 'sage' and what it aliases to. This will output a line

alias sage='xxx'

if an alias is set, otherwise no output will appear and you will just get the terminal prompt.

If the alias is set, it could be defined in a configuration file such as .bashrc or .bash_profile in your home directory.

Type which sage to check if some 'sage' can be found in your PATH. If for example you get:

$ which sage
/usr/local/bin/sage

this will tell you that 'sage' is found in /usr/local/bin/ and you can investigate further by typing

$ ls -alF /usr/local/bin/sage

which, if this 'sage' is a symlink, will tell you what it points to, for example:

/usr/local/bin/sage@ -> /Applications/sage-6.3/sage

I would recommend not using an alias, but a symlink in /usr/local/bin/ pointing to the sage executable.

To create such a symlink, type the following in a terminal

$ sudo ln -s /Applications/sage-6.3/sage /usr/local/bin/sage

(adapt according to the location of your Sage installation).

If you already had a symlink (to a previous version of sage), first do

$ sudo rm -f /usr/local/bin/sage

The last two commands start by 'sudo' because the /usr/local/bin/ you need administrator rights to write in /usr/local/bin/ (you will be asked to authenticate when you issue these commands).

edit flag offensive delete link more

Comments

Thank you so much. I finally figured out where the problem was. I kept calling `sage` from a wrong location.

Han gravatar imageHan ( 2014-09-15 15:49:34 +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: 2014-09-15 06:39:14 +0100

Seen: 1,897 times

Last updated: Sep 15 '14