Ask Your Question

How to add .sws notebook files to SageNB so that I can convert them into .ipynb?

asked 2020-10-02 16:08:05 +0200

Rolf gravatar image

I have a bunch of .sws files, that were made (I suppose) with the now-deprecated sage notebook. Currently the default notebook application for Sage files is Jupyter, which cannot open these files. I tried

  1. Using the built in "sagenb-export" command ( and also a standalone package ( in order to do it, but the notebook list in sagenb is empty (sagenb-export --list shows an empty list) and I could not make it to convert files that are not on this list. When running sage -n, there is an option "Convert old notebooks to Jupyter", but the list below that line is empty as well Is there a way of importing .sws files into this list?

  2. An alternative way was to use the -sws2rst and -rst2ipynb flags that I found in an answer here (, but that gives me ModuleNotFoundError: No module named 'sagenb'. Is it possible to install the sagenb module?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-10-02 17:31:54 +0200

tmonteil gravatar image

updated 2020-10-27 22:07:20 +0200

We are currently between two states. When Sage was supporting Python 2, sagenb provided a sage -sws2rst command. Now, that part of code has been extracted from sagenb and translated in Python 3, and will be availabe in the next (Sage 9.2) release, see trac ticket 28838. If you can not wait, you can install the latest beta release, run sage -i sage_sws2rst, and the sage -sws2rst command will be available.

EDIT Sage 9.2 is now out, so it should work now.

edit flag offensive delete link more


Thank you for the answer! Do I see it correctly that only the source code of the 9.2 beta is available to download? Would an older version that runs on Python 2 still work?

Rolf gravatar imageRolf ( 2020-10-05 15:57:07 +0200 )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: 2020-10-02 16:07:19 +0200

Seen: 485 times

Last updated: Oct 27 '20