PyCharm#
If you use JetBrains PyCharm, you can link your existing project directory and virtual environment in a few steps.
Open the Project Folder: Launch PyCharm, select Open, and select the project directory where you created your
.venv(or Conda environment) in Core Software.Configure the Python Interpreter: PyCharm usually auto-detects an existing
.venvfolder and selects it automatically (visible in the bottom-right status bar as.venv [3.xx.yy]). If it is not configured automatically:Click the interpreter widget in the bottom-right corner of the window, or open File > Settings (Windows/Linux) / PyCharm > Settings (macOS).
Go to Project: <your_project_name> > Python Interpreter.
Click Add Interpreter and select Add Local Interpreter….
Select Existing, then browse to the Python executable inside your
.venv:Windows:
.venv\Scripts\python.exemacOS / Linux:
.venv/bin/pythonFor Conda: Select Conda Environment, choose Use existing environment, and select your
opensim-envfrom the drop-down menu.
Verify OpenSim Import: Open a new
.pyfile or the built-in PyCharm Python Console (View > Tool Windows > Python Console) and run:import opensim import opynsim print(opensim.__file__)
For detailed documentation including step-by-step UI references, see the official JetBrains documentation: