When working in a virtual environment that imports ambersim, the following code will segfault:
from ambersim import ROOT
from ambersim.utils.io_utils import load_mj_model_from_file, load_mjx_model_and_data_from_file
filename = ROOT + "/models/pendulum/pendulum.xml"
# either of the below two lines segfaults
m = load_mj_model_from_file(filename)
m, d = load_mjx_model_and_data_from_file(filename)
If we simply add the line
import mujoco
anywhere before importing the model loading utils, then there is no segfault.
When working in a virtual environment that imports
ambersim
, the following code will segfault:If we simply add the line
anywhere before importing the model loading utils, then there is no segfault.