Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added note about DLL load filure

...

  1. If paths to previous OpenSim versions exist on your PYTHONPATH environment variable, remove them. (If you used OpenSim 4.2 with Python, this step is likely necessary.)
  2. Download Anaconda.
  3. Download the Anaconda environment file (conda_env_tgcs2021.yml) and place it directory of your choice; perhaps C:\Users\<PROFILE_NAME_HERE>\Documents\OpenSim\4.3\Code\Python (on Windows; replace <PROFILE_NAME_HERE> with your Windows profile name). This environment includes the following packages:
    1. Python 3.8
    2. NumPy 1.20.2
    3. Matplotlib
    4. Spyder (Python IDE)
  4. Open the Anaconda Prompt (terminal on macOS).
  5. Before proceeding, you may need to initialize conda for shell interaction by running

    Code Block
    C:\> conda init <shell-name>

    where <shell-name> is one of the following: cmd.exe (Windows default), bash (macOS default), powershell, fish, zsh, tcsh, xonsh.

  6. Navigate to the location of the Anaconda environment file. For example, if using cmd.exe on Windows:

    Code Block
    C:\> cd "C:\Users\<profile>\Documents\OpenSim\4.3\Code\Python"


  7. Create the environment from the file:

    Code Block
    C:\> conda env create -f conda_env_tgcs2021.yml


  8. Deactivate any existing environments and activate the Moco workshop environment. The prefix "opensim_moco_tgcs2021" should now appear in the Anaconda Prompt.

    Code Block
    (base) C:\> conda deactivate
    C:\> conda activate opensim_moco_tgcs2021
    (opensim_moco_tgcs2021) C:\>


  9. Navigate to folder sdk\Python in the OpenSim 4.3 installation; perhaps C:\OpenSim 4.3\sdk\Python (on Windows).
  10. If using Windows, first run the following:

    Code Block
    (opensim_moco_tgcs2021) C:\> python setup_win_python38.py


  11. Install OpenSim by running

    Code Block
    (opensim_moco_tgcs2021) C:\> python -m pip install .


  12. If using macOS, you may need to update the DYLD_LIBRARY_PATH to include the OpenSim and Simbody libraries:

    Code Block
    $ export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:<YOUR_INSTALL_DIRECTORY_HERE>/sdk/lib"
    $ export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:<YOUR_INSTALL_DIRECTORY_HERE>/sdk/Simbody/lib"

    where <YOUR_INSTALL_DIRECTORY_HERE> is the directory where you placed OpenSim installation.

  13. Once installation completes, test the configuration by checking the timestamp from running 

    Code Block
    (opensim_moco_tgcs2021) C:\> python
    >>> import opensim as osim
    >>> osim.GetVersionAndDate()
    >>> quit()

    in the Anaconda Prompt; the date should be in July 2021. Test that the visualizer is working by running the following

    Code Block
    (opensim_moco_tgcs2021) C:\> cd "C:\Users\<profile>\Documents\OpenSim\4.3\Code\Python\Moco"
    (opensim_moco_tgcs2021) C:\> python exampleSlidingMass.py

    You should see a visualizer window appear with a sliding mass animation. Hit ESC twice to close the window. If you get an error about loading DLL failure check that PATH has been updated correctly before relaunching the shell.

  14. The workshop examples can be complete by using a text editor and running the scripts from the Anaconda Prompt via "python <script_name>.py". However, if you prefer using an interactive development enviroment environment (IDE) similar to Matlab, we've included the Spyder IDE in the Anaconda environment. Launch Spyder by simply running

    Code Block
    (opensim_moco_tgcs2021) C:\> spyder


...