First time here? Check out the FAQ!

Ask Your Question
1

How can I alter default local sage configuration?

asked 8 years ago

DBS gravatar image

I have installed sagemath on my computer. Now I would like to change some default configuration options. For example my default browser is Firefox but I would like sage to use Chrome. If possible I would also like to define default home directory on sage. I presume there is a configuration file....where can I find it?

Thanks in advance for your help!

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 8 years ago

Preview: (hide)
link

Comments

Thank you! I am using sage in a linux system. In my home/.sage folder there seems to be no init.sage folder. What I have instead are the following folders: cache, db, gap, gp-expect.log, ipython, ipython-2.1.0, ipython-2.3.0, ipython-2.3.0.p0, ipython-3.0.0.p1, ipython-4.0.0, ipython_genutils-0.1.0, matplotlib-1.1.0, matplotlib-1.3.1, matplotlib-1.4.3, matplotlib-1.5.0, matplotlib-1.5.1, R, sage_notebook.sagenb, sage.txt, temp, tmp

DBS gravatar imageDBS ( 8 years ago )

init.sage should be a file, not a folder, and you should create it if it doesn't exist.

John Palmieri gravatar imageJohn Palmieri ( 8 years ago )

Oh, and it is a .sage file, so use Sage syntax in it.

John Palmieri gravatar imageJohn Palmieri ( 8 years ago )

Thank you. I didn't have an environment variable SAGE_BROWSER in my bash profile so I created one in my .bashrc file. However it still doesnt seem to implement it. Any ideas?

DBS gravatar imageDBS ( 8 years ago )

Maybe a silly question, but did you open a new shell so that changes in your .bashrc file took effect? If you run the shell command export, does it list SAGE_BROWSER? Meanwhile, you can experiment without restarting the shell by running export SAGE_BROWSER='/usr/local/bin/my_favorite_browser' and then running Sage.

John Palmieri gravatar imageJohn Palmieri ( 8 years ago )
1

answered 8 years ago

DBS gravatar image

updated 8 years ago

I accepted the answer above. In the spirit of someone else having similar issue here is what worked for me. I found the sage documentation somewhat unclear.

I took the following steps:

  • Create a init.sage file in .sage folder (most likely located in home folder) with the following code in it. Use the code :
    from sage.misc.viewer import viewer
    viewer.browser('open -a /path to your_fav_browser/YOUR_FAV_BROWSER')
    where YOUR_FAV_BROWSER is the browser you want.

  • Add the code export SAGE_BROWSER="YOUR_FAV_BROWSER"

NOTE: I am assuming bash already knows the path to YOUR_FAV_BROWSER.

Preview: (hide)
link

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: 1,794 times

Last updated: May 22 '16