Ask Your Question
1

Opening "old" Sage Notebooks in Jupyter: not UTF-8 encoded

asked 2019-06-19 16:32:32 +0100

thethinker gravatar image

updated 2019-08-29 18:50:35 +0100

FrédéricC gravatar image

I've decided to pay attention to the "Sage Notebook is Deprecated" message at the top of all of my Notebooks, and convert everything into Jupyter. So it seems that I'm got Jupyter running on my system (through Anaconda), but when I save all my SageMath notebooks (as .sws files, since that seems to happen by default), and open them in Jupyter, (I'm running Jupyter with "sage -n jupyter"), I get the message in the notebook that the file is not UTF-8 encoded, and nothing else (sorry, I can't for the life of me seem to cut and paste this exact message from the Jupyter notebook...).

I did a little searching and at least discovered this:

$ file -bi Embedded\ Torus\ in\ Invariant\ Coordinates\ \(S3\ Scale\ Factor\,\ Bump\).sws 
$ application/x-bzip2; charset=binary

So this file (and all my Sage Notebook Files) have "binary" listed as the character set. That seems bad to me - if it's a character set, shouldn't it be ASCII at least, or something?

Anyone know how I can get these notebooks into Jupyter? I can go back and save them as something different if I knew what I needed to do.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2019-06-20 11:15:24 +0100

eric_g gravatar image

updated 2019-06-20 17:18:12 +0100

You cannot open your sws notebooks directly with Jupyter. Rather, you should first convert them to ipynb format. This is easily done by running the Sage notebook exporter, via

sage -n

Under "Convert old notebooks to Jupyter", you will see the list of your sws notebooks. Click on one of them to convert it to Jupyter format.

edit flag offensive delete link more

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: 2019-06-19 16:32:32 +0100

Seen: 1,825 times

Last updated: Jun 20 '19