Create a new VS Code Python profile and activate it. This will install all recommended VS Code extensions for developing Python code.
Create a local development environment using the “How to create a local environment” guide. (Optional) You can create an environment with VS Code using the Create Environment command.
Activate your environment and install your project in editable mode. Optionally, also install dev requirements, if your project has them. To do this, you can run in a terminal:
pip install -r <path/to/dev-requirements.txt>
pip install -e .
Set up your VS Code Python interpreter to use the Python environment using the Python: Select Interpreter command.
Open the Python file you want to debug in VS Code. Familiarize yourself with the Debugger user interface, which you can open by clicking on the Run and Debug icon in the left menu bar.
You can now start debugging. Set Breakpoints by clicking in the gutter (the space to the left of the line numbers) or pressing F9 on the line where you want the debugger to pause execution.
For more detailed information about debugging in VS Code, refer to the Debug code with Visual Studio Code or the [Python debugging in VS Code](https://code.visualstudio.com/docs/python /debugging) documentation pages.