We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 558cc47 + 011ee0f commit fb80bd5Copy full SHA for fb80bd5
ipympl/backend_nbagg.py
@@ -1,5 +1,18 @@
1
"""Interactive figures in the Jupyter notebook"""
2
3
+import sys
4
+import types
5
+
6
+# In the case of a pyodide context (JupyterLite)
7
+# we mock Tornado, as it cannot be imported and would
8
+# lead to errors. Of course, any code using tornado cannot
9
+# work with this workaround, we prefer a half-working
10
+# solution than a non-working solution here.
11
+try:
12
+ import micropip # noqa
13
+except ImportError:
14
+ sys.modules['tornado'] = types.ModuleType('tornadofake')
15
16
import io
17
import json
18
from base64 import b64encode
0 commit comments