I recently updated to OpenSim 4.3 and had some interesting experiences with respect to getting the module to work within a Python environment. I'm not sure the below issues occurred with any consistency (as I went through a few different install attempts), and that these tips are 100% solid - but maybe my experience here as a reference could help iron out any similar issues others have.
For reference, this was installing OpenSim 4.3 on Windows, into a virtual Anaconda environment with Python 3.8.
- The instructions on the OpenSim Python install webpage obviously need to be followed, but I also believe these need to be followed in the exact order they are state in (i.e. add the dll directory via os FIRST, and then run the setup scripts.
- I think there is also a need to add the Simbody \bin as a dll directory as well, similar to what is instructed with OpenSim. Without doing this, I ran into an error with importing the opensim module, with this error relating to not being able to import things associated with Simbody.
- Once you get opensim installed and working, if you are using Spyder I found that installing the spyder package via different channels produced an interesting difference. I typically launch spyder from my environments via the Anaconda Prompt (i.e. command). Previously I've installed spyder from the conda-forge channel, and when doing this the output log from OpenSim (e.g. the optimisation steps from a Moco problem) gets displayed in the Anaconda command window (quite useful I think). I noticed this behaviour disappeared when I installed spyder using pip in recent environments, so this may be a consideration for Python users.
Aaron