Ask Your Question

file with extension sws

asked 2017-12-13 08:06:09 -0500

danielvolinski gravatar image

Hi All,

I downloaded several SageMath files with extension sws, but I am unable to open them with SageMath 8.0 on Windows native. Is there any translator from sws to ipynb file? How should I proceed?



edit retag flag offensive close merge delete


This is a possible duplicate of

Iguananaut gravatar imageIguananaut ( 2017-12-14 05:53:58 -0500 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2017-12-14 06:01:04 -0500

Iguananaut gravatar image

To be clear, this isn't anything specific to Windows. The .sws worksheets are for the legacy Sage Notebook software, that is largely being supplanted by the Jupyter Notebook which is what the Windows version provides by default.

You can still run the legacy notebook from the command-line by running the "SageMath Shell" and entering

sage -notebook=sagenb

Enter whatever you want for the "admin password" (It's not important; this is just a legacy of its original design to be a multi-user system). Then I think you have to actually "Upload" the sws files into the Notebook server; it doesn't allow you to directly browse the local filesystem.

This will allow you to quickly use those files, but I would suggest trying to convert them to the ipynb format as discussed in this question:

edit flag offensive delete link more


Hi iguananaut, I was able to access the files using the legacy sage, that is OK. Regarding the conversion, it did not work for me. I used the following command: sage -sws2rst riemann.sws riemann.rst It instructed me to install BeautifulSoup which I did with the following command easy_install BeautifulSoup I then proceeded to use the same convert command above and got: ('Processing', 'riemann.sws') bunch of stuff ... OSError: [Errno 13] Permission denied: '/tmp/tmp8zq48e/sage_worksheet/cells' What should I do now?

danielvolinski gravatar imagedanielvolinski ( 2017-12-14 07:18:30 -0500 )edit

For the conversion to ipynb, you should run sage -n and simply click on the name of your sws file, as it appears in the list "Convert old notebooks to Jupyter".

eric_g gravatar imageeric_g ( 2017-12-19 03:51:30 -0500 )edit

answered 2018-02-18 00:36:57 -0500

slelievre gravatar image

Convert SageNB (.sws) worksheets to Jupyter (.ipynb) worksheets

There are several ways to go, depending on whether you want to convert SageNB worksheets from your SageNB collection (they live in the .sage folder in your home folder), or .sws files that exist elsewhere in your filesystem.

For a SageNB .sws worksheet located somewhere visible in your file system, you could convert it to reStructuredText (.rst) using sws2rstand then convert the .rst file to a Jupyter .ipynb worksheet with rst-to-ipynb.

Or you could upload it to your SageNB collection, as indicated by @Iguananaut (run sage -n sagenb, upload the .sws files to your SageNB collection), then use the exporter (launch it by running sage -n export in a terminal) which will offer to export all SageNB worksheets in your SageNB collection to Jupyter worksheets.

edit flag offensive delete link more


As I mentioned in the comment to the first answer, the sws2rst command did not work for me.

Moreover the sage -n sagenb and sage -n export open a window but there is no list of files to be translated to the new format so I can select any file.

And another question: I found SageMath files with extension *.sagews, how to translate those?

I found several old extensions of SageMath: *.sage, *.sagews, *.sws. Are there more?

I'm working with SageMath 8.1 on Windows 10 Native.



danielvolinski gravatar imagedanielvolinski ( 2018-02-18 13:01:07 -0500 )edit

Sorry, I meant "I can't select any file"

danielvolinski gravatar imagedanielvolinski ( 2018-02-18 13:01:51 -0500 )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


Asked: 2017-12-13 08:06:09 -0500

Seen: 2,710 times

Last updated: Feb 18 '18