pinocchio: Segmentation Fault when importing pinocchio in python on M1 Mac
Hey everyone, I’m trying to get a python program using pinocchio to run on my M1 mac. Unfortunately I always encounter a segmentation fault when trying to run the program. I’m using a conda environment and installed pinocchio through conda-forge. Every program importing pinocchio fails with the same fault. When running the program with a fault handler this stack is returned:
python -Xfaulthandler test.py
Fatal Python error: Segmentation fault
Current thread 0x0000000102dc4580 (most recent call first):
File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 1176 in create_module
File "<frozen importlib._bootstrap>", line 571 in module_from_spec
File "<frozen importlib._bootstrap>", line 674 in _load_unlocked
File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
File "/Users/davidkaufmann/miniforge3/envs/test/lib/python3.10/site-packages/pinocchio/__init__.py", line 6 in <module>
File "<frozen importlib._bootstrap>", line 241 in _call_with_frames_removed
File "<frozen importlib._bootstrap_external>", line 883 in exec_module
File "<frozen importlib._bootstrap>", line 688 in _load_unlocked
File "<frozen importlib._bootstrap>", line 1006 in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1027 in _find_and_load
File "/Users/davidkaufmann/development/ba/test.py", line 1 in <module>
Extension modules: numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator (total: 13)
zsh: segmentation fault python -Xfaulthandler test.py
The Programm executed just imports pinocchio and prints hello world:
import pinocchio
import faulthandler
faulthandler.enable()
print("Hello World")
For the conda environment, I only installed python and pinocchio. I’m new to this space so maybe I just did something terribly wrong, but a friend working on a different machine had no issues following this workflow. Do you have any ideas about what is going on? If something remained unclear I am happy to clarify. Thanks a lot for any help.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (13 by maintainers)
Yeah, it now works for me as well. Thanks a lot for the quick help.
Great! Let’s hope this is just a temporary problem, otherwise we may neeed to think a more robust solution.
It looks like the suggestion made by @traversaro works perfectly. Thanks to him for the very useful feedback. @KaufmannDavid You should be able to do:
conda install -c conda-forge pinocchio --force-reinstall