Page 1 of 1

Scripting in Python

Posted: Fri Oct 30, 2020 9:14 am
by jmayenburg
I am using OpenSim 4.1 on my Windows 10 64 bit system. I am following the tutorial in https://simtk-confluence.stanford.edu:8 ... +in+Python.

I run the code in Anaconda Command Prompt, and receive this message:
Installed c:\users\jess\anaconda3\lib\site-packages\opensim-4.1-py3.8.egg
Processing dependencies for opensim==4.1
Finished processing dependencies for opensim==4.1


When I try to run the import opensim command in Spyder, I receive this output:

import opensim
Traceback (most recent call last):

File "<ipython-input-2-d100d6ac66f2>", line 1, in <module>
import opensim

File "C:\Users\Jess\anaconda3\lib\site-packages\opensim-4.1-py3.8.egg\opensim\__init__.py", line 1, in <module>
from .simbody import *

File "C:\Users\Jess\anaconda3\lib\site-packages\opensim-4.1-py3.8.egg\opensim\simbody.py", line 18, in <module>
_simbody = swig_import_helper()

File "C:\Users\Jess\anaconda3\lib\site-packages\opensim-4.1-py3.8.egg\opensim\simbody.py", line 17, in swig_import_helper
return importlib.import_module(mname)

File "C:\Users\Jess\anaconda3\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.


I have added C:\OpenSim 4.1 to my path, and I have double-checked that I did install the 64-bit version of both OpenSim and Python. Is is possible that I'm missing a DLL? I'm not sure what could be wrong here.

Edited to Add:
I have added C:\Users\Jess\anaconda3\lib\site-packages\opensim-4.1py3.egg\opensim to my path, and also checked the file path to see that there are NO .dll files there. Should there be?

Re: Scripting in Python

Posted: Fri Oct 30, 2020 1:42 pm
by aymanh
Hello,

Thanks for reporting, but python version 3.8 is not supported yet by our API bindings, please revert to version 3.7 or earlier. There is an open issue in our development environment to track this.

Sorry for the inconvenience,
-Ayman

Re: Scripting in Python

Posted: Tue Nov 03, 2020 2:08 pm
by jmayenburg
Re-installed Anaconda with 3.7 and it works!! Thank you