Page 1 of 1

ImportError: DLL load failed while importing _simbody

Posted: Tue Jun 27, 2023 12:26 am
by stagepapendal
Dear,

When following the installation guide on the website: https://simtk-confluence.stanford.edu:8 ... +in+Python
the following error appears:

ImportError: DLL load failed while importing _simbody: cannot find given module.

The website says: 'If you get an error about loading DLL failure check that PATH has been updated correctly before relaunching the shell' (
Spyder OpenSim error.png
Spyder OpenSim error.png (115.13 KiB) Viewed 750 times
) but I feel like the path is correct and the simbody file is in the map (
opensim path.png
opensim path.png (130.62 KiB) Viewed 750 times
see ).

How and to which path should I change to be able to import _simbody?

I am looking forward to your response.

Kind regards,

Jip Helsloot

Re: ImportError: DLL load failed while importing _simbody

Posted: Tue Jun 27, 2023 10:38 am
by kernalnet
Hi, please specify the versions of OpenSim and Python installed. Also, do you use official Python or Conda distribution?

Re: ImportError: DLL load failed while importing _simbody

Posted: Wed Jun 28, 2023 8:01 am
by m.kindler
Hello, for me this helped:
I guess you are using windows...
I had to add these two lines before every opensim import...

import os
os.add_dll_directory("C:/OpenSim 4.4/bin")

"C:/OpenSim 4.4/bin" could be different depending on where you installed Opensim

Re: ImportError: DLL load failed while importing _simbody

Posted: Fri Jun 30, 2023 12:32 am
by stagepapendal
I tried this because I am working on windows:
import os
os.add_dll_directory("C:/OpenSim 4.4/bin")
Unfortunately this didn't work for me, I still get the same error.



@Mohammadreza Rezaie
My OpenSim version is 4.4 and my python version is 3.9
I used anaconda and spyder.

Best,

Jip

Re: ImportError: DLL load failed while importing _simbody

Posted: Mon Jul 03, 2023 8:03 am
by kernalnet
The package comes with OpenSim 4.4 installer works with Python 3.8 only. But you can use the conda package that works with recent versions: https://anaconda.org/opensim-org/opensim