DLL load failed while importing opensim with python3.5

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Saurabh Kothari
Posts: 12
Joined: Fri Aug 19, 2016 10:23 am

DLL load failed while importing opensim with python3.5

Post by Saurabh Kothari » Wed Aug 07, 2019 2:48 am

Hi All,

I am using windows 10 64 bit system and trying to install OpenSim 4.0 python package in conda environment having 64 bit python 3.5. I have followed this steps: https://simtk-confluence.stanford.edu:8 ... honpackage

After running "python setup.py install", I get this:

Code: Select all

running install
running bdist_egg
running egg_info
writing opensim.egg-info\PKG-INFO
writing dependency_links to opensim.egg-info\dependency_links.txt
writing top-level names to opensim.egg-info\top_level.txt
reading manifest file 'opensim.egg-info\SOURCES.txt'
writing manifest file 'opensim.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
copying opensim.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying opensim.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying opensim.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying opensim.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
opensim.__pycache__.actuators.cpython-35: module references __file__
opensim.__pycache__.analyses.cpython-35: module references __file__
opensim.__pycache__.common.cpython-35: module references __file__
opensim.__pycache__.examplecomponents.cpython-35: module references __file__
opensim.__pycache__.simbody.cpython-35: module references __file__
opensim.__pycache__.simulation.cpython-35: module references __file__
opensim.__pycache__.tools.cpython-35: module references __file__
creating 'dist\opensim-4.0-py3.5.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing opensim-4.0-py3.5.egg
creating c:\users\saurabh\anaconda3\envs\nengodl\lib\site-packages\opensim-4.0-py3.5.egg
Extracting opensim-4.0-py3.5.egg to c:\users\saurabh\anaconda3\envs\nengodl\lib\site-packages
Adding opensim 4.0 to easy-install.pth file

Installed c:\users\saurabh\anaconda3\envs\nengodl\lib\site-packages\opensim-4.0-py3.5.egg
Processing dependencies for opensim==4.0
Finished processing dependencies for opensim==4.0
This shows that opensim is installed, but when I try to run "import opensim", I get the following error:

Code: Select all

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\OpenSim 4.0\sdk\Python\opensim\__init__.py", line 1, in <module>
    from .simbody import *
  File "C:\OpenSim 4.0\sdk\Python\opensim\simbody.py", line 18, in <module>
    _simbody = swig_import_helper()
  File "C:\OpenSim 4.0\sdk\Python\opensim\simbody.py", line 17, in swig_import_helper
    return importlib.import_module(mname)
  File "C:\Users\Saurabh\Anaconda3\envs\nengodl\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed: The specified module could not be found.
Note: The DLL directory (C:\OpenSim 4.0\bin) is already on the system PATH. And the above steps works totally fine with python 2.7 conda environment, but not with python 3.5. Also, python 3.5 was working fine with the OpenSim 4.0 Beta version. Are the DLL files of latest OpenSim 4.0 are fine?

Can anyone help me with this?

Thanks,
Saurabh

Tags:

User avatar
Ayman Habib
Posts: 2248
Joined: Fri Apr 01, 2005 12:24 pm

Re: DLL load failed while importing opensim with python3.5

Post by Ayman Habib » Wed Aug 07, 2019 8:34 am

Hello,

It has been reported that OpenSim 4.0 doesn't work with some Python3 installations. Keep in mind that we distributed and tested the 4.0 package against the standard python (2.7) from python.org. We plan to distribute python3 bindings going forward but you can easily generate your own bindings (e.g. to python3) by building from source and specifying the desired python version to cmake.

With multiple python environments in use there's also the possibility of incompatibility due to differences in low level libraries (typically microsoft runtime libraries) that can cause bindings to work in one environment and not another. I'd suggest you stick with python from python.org to help isolate the problem before trying other environments

Best regards,
-Ayman

POST REPLY