Ask Your Question
4

Running sage with files on DropBox

asked 2012-07-03 14:51:51 +0100

calc314 gravatar image

updated 2012-11-24 14:50:58 +0100

I'm curious to know whether you can run Sage on a local machine but have your worksheets saved on DropBox. Then, I could run on my home or work computer and see the same worksheets. An answer to the question Execute notebook sessions without storing it at the server says that such functionality was being worked on in Spring 2011. What is the current status? Can it be done, or is this unwise for some security reason?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
8

answered 2012-07-03 17:23:04 +0100

updated 2012-07-03 22:11:11 +0100

I just started to do this a few days ago. I set the variable DOT_SAGENBto point to a directory in my DropBox folder, and so the Sage notebook looks in this directory for its worksheets. (I think the question you referred to dealt with the Sage notebook server running at sagenb.org, for example, not Sage running on a local machine.)

You can instead set DOT_SAGE to a directory in your DropBox folder; then Sage will look for all of its files there. (If DOT_SAGENB is not set, it defaults to DOT_SAGE, and if DOT_SAGE is not set, it defaults to $HOME/.sage.) But running Sage, and even more so, doctesting Sage, produces many temporary files in DOT_SAGE, and there is no purpose sharing those in a DropBox folder.

Edit: set the environment variable DOT_SAGENB in the file $HOME/.profile, assuming you're running bash. Add a line like

export DOT_SAGENB=~/Dropbox/sage-notebooks/

Then restart your terminal window so this file is read and executed. Then run Sage. If you want to check what Sage thinks DOT_SAGENB is set to, run this at a shell prompt:

sage -sh -c 'echo $DOT_SAGENB'
edit flag offensive delete link more

Comments

Is there a settings file in which I should do this so that Sage starts up this way each time? Which file would that be and where? Thank you for the help!

calc314 gravatar imagecalc314 ( 2012-07-03 20:43:51 +0100 )edit

To be honest, things are not running completely smoothly: I get occasional error messages in the console. I can't pinpoint where the problems are, but be warned...

John Palmieri gravatar imageJohn Palmieri ( 2012-07-03 22:06:51 +0100 )edit

Thanks. I'm experimenting to see what works. So far, I've had only a few issues. But, I do wonder about how much it hits Dropbox. From a slow internet connection (i.e., home), this might not work well.

calc314 gravatar imagecalc314 ( 2012-07-03 23:37:52 +0100 )edit

Just an update on my brief experience with this experiment... 1) The errors that I'm currently getting are all due to being on a computer that doesn't have something installed that is installed at sagenb.org. For example, I have a laptop without gcc and a worksheet that calls gcc to compile something. 2) The file I had to do the above environment variable setting in was `$home/.bash_profile`. This is on a Mac running OS 10.6.8.

calc314 gravatar imagecalc314 ( 2012-07-05 14:36:12 +0100 )edit
0

answered 2014-04-19 19:44:07 +0100

k1 gravatar image

This is what I did:

sage -n '~/Dropbox/Sage'

It creates a folder called Sage.sagenb and it works like your local sagenb folder in Sage installation folder. Then it asks for admin password if it's the first time you're running it in that folder.

edit flag offensive delete link more
0

answered 2012-10-08 22:15:39 +0100

calc314 gravatar image

I've now upgraded to Mac OS 10.8.2 (Mountain Lion) and am having some trouble getting Sage to read the dropbox files. I could use some advice.

I can get the notebook to open and run by using the following command at a sage prompt:

notebook(interface='localhost', directory='./sage_notebook.sagenb',port=8000)

Based on some experimenting, Sage isn't finding the dropbox directory when I try entering other things for the directory.

Any thoughts?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

4 followers

Stats

Asked: 2012-07-03 14:51:51 +0100

Seen: 6,351 times

Last updated: Apr 19 '14