python 3.8

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Bernardo Costa
Posts: 12
Joined: Tue Jul 16, 2019 11:56 am

python 3.8

Post by Bernardo Costa » Mon Feb 17, 2020 11:21 am

I was testing OpenSim 4.1 installation and python scripting using this URL:
https://simtk-confluence.stanford.edu/d ... +in+Python

For some unknown reason, my python installation cannot load some dll although my PATH and PYTHONPATH has the above configuration. This machine is a Windows 10 64 bit and python is 3.8.1 also 64-bit. The install step has been done without any errors. What could possibly be going wrong here?

OPENSIM_HOME=C:\OpenSim 4.1
PATH=%PATH%;%OPENSIM_HOME%/bin
PYTHONPATH=%OPENSIM_HOME%\sdk\Python;%OPENSIM_HOME%\sdk\Python\opensim

Error message:

C:\Users\LCG\Documents\OpenSim\4.1\Code\Python>python3 build_simple_arm_model.py
Traceback (most recent call last):
File "build_simple_arm_model.py", line 34, in <module>
import opensim as osim
File "C:\OpenSim 4.1\sdk\Python\opensim\__init__.py", line 1, in <module>
from .simbody import *
File "C:\OpenSim 4.1\sdk\Python\opensim\simbody.py", line 18, in <module>
_simbody = swig_import_helper()
File "C:\OpenSim 4.1\sdk\Python\opensim\simbody.py", line 17, in swig_import_helper
return importlib.import_module(mname)
File "C:\Python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing _simbody: The specified module could not be found.

Tags:

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

Re: python 3.8

Post by Ayman Habib » Mon Feb 17, 2020 3:49 pm

Hi Bernardo,

OpenSim 4.1 was built and tested against version 3.7 of python from python.org. Can you try this version and let us know if it works for you? Would help if we can figure out if this is specific to your environment or generic issue with python 3.8 or to a specific python distribution.

Thank you,
-Ayman

User avatar
Bernardo Costa
Posts: 12
Joined: Tue Jul 16, 2019 11:56 am

Re: python 3.8

Post by Bernardo Costa » Wed Feb 19, 2020 7:41 am

Ok, so here is the deal from the tests I have made...
  • OpenSim4.0 + python2.7 seems ok
  • OpenSim4.1 + python3.7 seems ok
  • OpenSim4.1 + python3.8 fails while loading _simbody.pyd
This was tested with two different windows 10 machines. Note that if %OPENSIM_HOME%\bin is not in %PATH% the combo OpenSim4.1 + python3.7 also fails.

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

Re: python 3.8

Post by Ayman Habib » Wed Feb 19, 2020 10:50 am

Thanks for the thorough investigation, Bernardo.

The %PATH% needs to be set for the native opensim libraries to be found so this is expected behavior, please let us know if our documentation is not clear on that.

It's likely that our python bindings are not compatible with python 3.8 changes, if you really need 3.8, you can try building OpenSim from source and use your python 3.8 (instructions here https://github.com/opensim-org/opensim-core) and let us know how it goes.

Best regards,
-Ayman

POST REPLY