1. Download and install Visual Sudio Code.

  2. Open VS Code, go to the Extensions view by clicking the Extensions icon on the left sidebar, and type “Python” in the search field. Install the first extension that appears in the list, developed by Microsoft.

     If it’s not already installed, click the blue install button.

    If it’s not already installed, click the blue install button.

  3. Open a new empty folder where you'll store a testing project. In your new folder, create a file called main.py.

image.png

  1. Edit main.py:

    import opensim as osim
    print(osim.GetVersionAndDate())
    quit()
    
  2. Select your conda environment, press “Cmd/Ctrl+Shift+P”, and search “Python: Select interpreter”. Choose the conda environment you previously created from the list of available environments.

Screenshot 2024-05-06 at 14.37.15.png

Screenshot 2024-05-06 at 14.39.02.png

  1. In the Command Palette, type "Preferences: Open User Settings (JSON)" and select it.

  2. Add this line, and relaunch VS Code:

    "terminal.integrated.inheritEnv": false,
    "python.terminal.executeInFileDir": true,
    "terminal.integrated.defaultProfile.osx": "zsh",
    "terminal.integrated.env.osx": { "PYTHONPATH": "${workspaceFolder}/:${workspaceFolder}/.."}
    
  3. Run the main.py by pressing the play button in the upper-right corner of VS Code to run the script. You should see output similar to this in the terminal at the bottom of the window:

    C:\\ProgramData\\anaconda3\\python.exe C:\\Users\\anacs\\PycharmProjects\\pythonProject\\main.py 
    version 4.4.1-2023-07-13-710e13be5, build date 09:37:16 Jul 14 2023
    
    Process finished with exit code 0
    

Previous step:

3) Python environment with Moco (Windows)

4) Python environment with Moco (macOS)

Next step :

None. All done! 🎉


Back to Home