ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 05 Oct 2020 08:57:07 -0500How to add .sws notebook files to SageNB so that I can convert them into .ipynb?https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/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?Fri, 02 Oct 2020 09:07:19 -0500https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/Answer by tmonteil for <p>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</p>
<ol>
<li><p>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 (<code>sagenb-export --list</code> shows an empty list) and I could not make it to convert files that are not on this list. When running <code>sage -n</code>, 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?</p></li>
<li><p>An alternative way was to use the <code>-sws2rst</code> and <code>-rst2ipynb</code> 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 <code>ModuleNotFoundError: No module named 'sagenb'</code>. Is it possible to install the sagenb module?</p></li>
</ol>
https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/?answer=53704#post-id-53704We 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](https://trac.sagemath.org/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.Fri, 02 Oct 2020 10:31:54 -0500https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/?answer=53704#post-id-53704Comment by Rolf for <p>We are currently between two states. When Sage was supporting Python 2, <code>sagenb</code> provided a <code>sage -sws2rst</code> command. Now, that part of code has been extracted from <code>sagenb</code> and translated in Python 3, and will be availabe in the next (Sage 9.2) release, see <a href="https://trac.sagemath.org/ticket/28838">trac ticket 28838</a>. If you can not wait, you can install the latest beta release, run <code>sage -i sage_sws2rst</code>, and the <code>sage -sws2rst</code> command will be available.</p>
<p><strong>EDIT</strong> Sage 9.2 is now out, so it should work now.</p>
https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/?comment=53728#post-id-53728Thank 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?Mon, 05 Oct 2020 08:57:07 -0500https://ask.sagemath.org/question/53703/how-to-add-sws-notebook-files-to-sagenb-so-that-i-can-convert-them-into-ipynb/?comment=53728#post-id-53728