Ask Your Question
2

SageMath 8.0, OS windows 10 (no VM), .ipnyb files location default

asked 2017-12-08 18:48:24 +0100

ortollj gravatar image

SageMath 8.0 under windows 10 if I did not first open a file under my folder C:\Users\mySurNameLogin\Documents\SMW when I back up my current notebook sagemath , the .ipnyb file is not under this directory.

By doing a search under windows 10 files of type .ipynb from c: I find that these files are under the folder C:\Users\mySurNameLogin. is there a variable to set, so that automatically, the backup of my sagemath notebooks files will be under C:\Users\mySurNameLogin\Documents\SMW ?

On the other hand, we can not overwrite a .ipynb file with a new version with the same name !. I have to add a new suffix for SageMath to allow me to save the new file version.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-12-09 19:35:43 +0100

Iguananaut gravatar image

Hi,

SageMath is originally based on UNIX-like systems, so many concepts from that are carried over to the Windows port (albeit in a way that is not unusual for other Windows software as well). In any software program there is a concept of a "current working directory" which is the folder under which files are opened and saved by default (when not otherwise specifying a full path).

In many cases the default current working directory is your user "home" directory, which has no direct analogue on Windows, but the nearest approximation is the C:\Users\<username>\ directory, as you've found.

I'm not sure why you were expecting a notebook to be saved under Documents\SMW. In the Jupyter notebook it displays, by default, a directory listing of your current directory (again, in this case, your "home" directory by default). When you create a new notebook from this page that's the directory that the notebook is saved to (this is true on any platform, not specific to Windows). However, if you use the Jupyter Notebook's file browser to navigate to a specific directory (e.g. click "Documents" then "SMW") then start a new notebook from there then that's where it will be saved to. Of course you can always move the .ipynb file to wherever you want after the fact as well.

I would post screenshots to demonstrate but I'm on my phone right now.

Now, if you want Sage to always start in a different directory this can be done too, but is a bit tricky and requires editing some startup files. I can get back to you later on that if you think it's worth bothering.

edit flag offensive delete link more

Comments

Ok thanks iguananaut. no it is not essential , it was just a remark .

ortollj gravatar imageortollj ( 2017-12-10 10:08:54 +0100 )edit

Hi Iguananaut, What can I do to make Sage to always start in a specific directory? Thanks, Daniel

danielvolinski gravatar imagedanielvolinski ( 2017-12-10 16:06:25 +0100 )edit

See https://github.com/sagemath/sage-wind... for tracking the issue of making it easier to change the home directory for Sage.

Iguananaut gravatar imageIguananaut ( 2017-12-11 16:41:37 +0100 )edit
1

Note that a workaround has now been posted at - https://github.com/sagemath/sage-windows/issues/10

slelievre gravatar imageslelievre ( 2018-05-15 15:52:04 +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: 2017-12-08 18:48:24 +0100

Seen: 3,961 times

Last updated: Dec 09 '17