I open a live Python repo (https://petrkryslucsd.github.io/pystran.live/lab/index.html?path=Welcome.ipynb). I click through to the folder pystran/tutorials. I create a notebook (Pyodide) with a single cell
import context
from pystran import model
Execution fails with
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 2
1 import context
----> 2 from pystran import model
File /drive/pystran/pystran/__init__.py:81
65 __all__ = [
66 "gauss",
67 "model",
(...) 77 "Abaqus_import"
78 ]
80 # Import the submodules
---> 81 from . import model
82 from . import section
83 from . import rotation
File /drive/pystran/pystran/model.py:7
5 from math import sqrt, pi
6 from numpy import array, zeros, dot, mean, concatenate, float64, int32, inf
----> 7 import scipy
8 from scipy.linalg import solve, eigh
9 from collections import namedtuple
ModuleNotFoundError: No module named 'scipy'
But if I put into the cell
import context
import scipy
from pystran import model
it executes without an error.
Also, when I open an existing notebook, the very same import of context and from pystran import model works fine.
I don't understand why that is?
lang-py