executablebooks / sphinx-thebe

A Sphinx extension to convert static code into interactive code cells with Jupyter, Thebe, and Binder.
https://sphinx-thebe.readthedocs.io/en/latest/
MIT License
28 stars 15 forks source link

FIX: Kernelspec dict error #51

Closed choldgraf closed 2 years ago

choldgraf commented 2 years ago

This fixes a bug that pops up when the kernelspec that is read by myst-nb is passed as a dictionary instead of a JSON string. This seems to happen only under certain circumstances, I'm not sure when, so this PR handles both cases now:

Here's what the error was looking like:

Handler <function update_thebe_context at 0x7f2eb5effca0> for event 'doctree-resolved' threw an exception (exception: the JSON object must be str, bytes or bytearray, not dict)
NikosAlexandris commented 10 months ago

I still get this error. Which sphinx-theme version is the "good" one? Is this https://github.com/executablebooks/jupyter-book/blob/6b0275a241ed053c35f4d5b548716ad947f7dd44/pyproject.toml#L44 requirement correct?