Open a terminal window and create a new environment named “opensim” with python*.*
Activate the environment to work in it and check that the python version installed is the one that you want.
conda activate opensim
python --version
Install numpy and matplotlib in this new environnement cause they are useful and basic packages.
pip install numpy
pip install matplotlib
Navigate to "/Applications/OpenSim\ 4.5/sdk/Python"
cd /Applications/OpenSim\\ 4.5/sdk/Python
When you are on the folder, install OpenSim and OpenSim Moco packages. You need to have administrator rights, that’s why we use sudo and you will need to enter your passcode.
sudo python -m pip install .
Test if the installation works, by running :
python
import opensim as osim
osim.GetVersionAndDate()
quit()
<aside> ⚙ Now you have installed OpenSim and OpenSim Moco. There is still one problem: you can use it in this terminal window, but when you want to use it elsewhere, the libraries won't import automatically, and it won't work.
</aside>
<aside> 💡 We are going to change the bash of “activate” function, so that as soon as we activate our environment, the libraries will be automatically imported.
</aside>
Copy the “/Applications/OpenSim\ 4.5/sdk” folder, in “/opt/anaconda3/envs/opensim/lib”.
To test if everything works well, open a new terminal and try commands from 6. It should print the same thing as before.
conda activate opensim
python
import opensim as osim
osim.GetVersionAndDate()
quit()
The next step is to setup an IDE, you can use as you want VS Code or Pycharm, the installation steps are the same regardless of your OS.
Previous step:
Next step: