Ask Your Question
2

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 (ask.sagemath.org/question/35873/how-to-automatically-convert-many-sws-to-ipynb/) and also a standalone package (github.com/vbraun/ExportSageNB) 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 (ask.sagemath.org/question/35873/how-to-automatically-convert-many-sws-to-ipynb/?answer=38197#post-id-38197), 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
3

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

Comments

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

Stats

Asked: 2020-10-02 16:07:19 +0200

Seen: 457 times

Last updated: Oct 27 '20