0

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?

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.