opensim-core: ModuleNotFoundError No module named '_simbody'

Hello,

Following setup:

  • win10
  • anaconda
  • visual studio 2019 (v16.8.6)
  • cmake 3.19.5
  • swigwin 3.0.12
  • opensim 4.1
    • opensim python wrapping
  • simbody master commit 9daf0d26ea22551a5d10114bffd9b02fa51c53bc

Due to an error while installing opensim dependencies / simbody with latest Version of Visual Studio 2019 compiling simbody 3.7 release I installed simbody manually using simbody bleedingedge master (commit 9daf0d26ea22551a5d10114bffd9b02fa51c53bc). This includes a merge of following pull request, wich solves an issue with the Visual Studio 2019: https://github.com/simbody/simbody/pull/707. Installation (as described here: https://github.com/simbody/simbody/tree/9daf0d26ea22551a5d10114bffd9b02fa51c53bc#windows-using-visual-studio) was successfull (run_tests_parallel succeeded without any error). After that installed opensim 4.1 release from source. (including opensim python wrapping). Opensim installation with visual studio 2019 was successfull, (run all tests parallel without any error). Installing opensim, set path variable and install setup.py in the conda env were done.

After installing opensim opensim module is recognized in our python repository, but the simbody submodule is not:

Exception has occured: ModuleNotFoundError 
No module named '_simbody'

Is that still an error of simbody or a problem with opensim? Any idea how to fix this?

kind regards, patrisity

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28 (23 by maintainers)

Commits related to this issue

Most upvoted comments

For anyone trying to set a conda environment up to add/remove LD_LIBRARY_PATH on activation/deactivation (probably me in the future), here’s what I did I used: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#macos-and-linux as a guide.

  1. Activate the conda environment you’ve installed opensim
  2. Create files that are used/checked during activation/deactivation.
cd $CONDA_PREFIX
mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/env_vars.sh
touch ./etc/conda/deactivate.d/env_vars.sh
  1. Edit ./etc/conda/activate.d/env_vars.sh as follows:
export ORIG_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
  1. Edit ./etc/conda/deactivate.d/env_vars.sh as follows:
export LD_LIBRARY_PATH=$ORIG_LD_LIBRARY_PATH

Then, when you conda activate env_name it will add $CONDA_PREFIX/lib to LD_LIBRARY_PATH and when you conda deactivate it will return the LD_LIBRARY_PATH to what it was before activation. The one downside is that this might cause issues if you change the LD_LIBRARY_PATH when an environment is activated (the change you made will be undone when you deactivate).

After glancing at the release notes for NumPy 1.20, downgrading to 1.19.2 should be fine. We should also update the README.md to include the required NumPy version and also consider implementing some basic error handling when importing the OpenSim python modules.

@antoinefalisse I don’t think we need a late version of numpy for OpenSim bindings, if we use 1.19.2 that may work out better for everybody. Not sure how to enforce but would be good to find out first from @nickbianco if that’s the case.

@antoinefalisse version 4.1 of opensim didn’t include or require numpy, so this’s expected