DLL load failed: The specified module could not be found

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Xijin Hua
Posts: 29
Joined: Tue Feb 12, 2019 4:45 pm

DLL load failed: The specified module could not be found

Post by Xijin Hua » Fri Apr 14, 2023 1:23 pm

Hi OpenSim experts

I am using python script to run OpenSim. When I run

Code: Select all

import opensim
it fails and I got the error below:

Code: Select all

Traceback (most recent call last):
  File "D:\XijinHua\GitHub_xj-hua\Simulation_printAFO_CAMG_20230107\Simulation_printAFO\test.py", line 1, in <module>
    import opensim
  File "C:\Python 3.7.6\Python37\lib\site-packages\opensim-4.1-py3.7.egg\opensim\__init__.py", line 1, in <module>
    from .simbody import *
  File "C:\Python 3.7.6\Python37\lib\site-packages\opensim-4.1-py3.7.egg\opensim\simbody.py", line 18, in <module>
    _simbody = swig_import_helper()
  File "C:\Python 3.7.6\Python37\lib\site-packages\opensim-4.1-py3.7.egg\opensim\simbody.py", line 17, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Python 3.7.6\Python37\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
My OpenSim version is 4.1 and python version is 3.7.6.

I know there are a few topics related to the "DLL load failed" issue in the forum, but the problem for me is that I could run the script successfully well without this error a month ago. A month later, I got this error without changing anything. I would like to continue using my well configured script, but I am not sure why this happened. Is there anyone know the reasons and could provide any help? Thanks.

Tags:

User avatar
Mohammadreza Rezaie
Posts: 379
Joined: Fri Nov 24, 2017 12:48 am

Re: DLL load failed: The specified module could not be found

Post by Mohammadreza Rezaie » Fri Apr 14, 2023 10:28 pm

Hi, please double-check if OpenSim bin folder already exists in your system environment path.

User avatar
Xijin Hua
Posts: 29
Joined: Tue Feb 12, 2019 4:45 pm

Re: DLL load failed: The specified module could not be found

Post by Xijin Hua » Sat Apr 15, 2023 2:57 am

Yes, it is still in the system environment path.

User avatar
Mohammadreza Rezaie
Posts: 379
Joined: Fri Nov 24, 2017 12:48 am

Re: DLL load failed: The specified module could not be found

Post by Mohammadreza Rezaie » Sat Apr 15, 2023 3:37 am

Please double-check if there is only one version of OpenSim in the environment path. Otherwise, there may be interference.

You can also try this one before importing OpenSim:

Code: Select all

import sys
sys.path.insert(0, opensim_bin_directory)

POST REPLY