Skip to content

Commit

Permalink
feat: micropip install in deps before imports to fix and clean examples
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumJHays committed Oct 25, 2022
1 parent 64325e2 commit 3be2d8e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mathpad/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
try:
# pre-load required packages if we are running in pyodide.
# if we don't do this, we get import errors even though the modules are importable from the IPython console.
import micropip
micropip.install(['sympy', 'typing_extensions', 'plotly', 'scipy', 'tqdm'])
except ImportError:
# if micropip isn't available, we're not running in pyodide.
pass

import sympy

from mathpad.val import *
Expand Down

0 comments on commit 3be2d8e

Please sign in to comment.