Skip to content

TPI: Test Debug Python File in Editor Menu #141

Closed

Description

@paulacamargo25

Refs: #137

Complexity: 3

Create Issue


Prerequisites:

  • Install the debugpy extension.
  • Install Python

Part 1: Test Debug Python File

  1. Open a python file that you want to debug.
  2. On the top right you will see a play button with an arrow, click the arrow and then click: Python Debugger: Debug Python File
  3. You can add breakpoints and make sure that the debug works properly.

Part 2: Test Debug Python File with launch.json(no config set)

  1. Open a python file that you want to debug. (Make sure that you don't have a launch.json config already set)
  2. On the top right you will see a play button with an arrow, click the arrow and then click: Python Debugger: Debug using launch.json
  3. Make sure a prompt is displayed to create a launch.json. Follow the steps.
  4. Make sure that a launch.json is created and the debugger runs properly.

Part 3: Test Debug Python File with launch.json (config already set)

  1. Open a python file that you want to debug. (Make sure that you have a launch.json config already set)
  2. On the top right you will see a play button with an arrow, click the arrow and then click: Python Debugger: Debug using launch.json
  3. Make sure a prompt is displayed that shows all the configurations that you already have. Choose the one that you want to run.
  4. Make sure that the debugger runs properly.

Activity

  1. removed their assignment
    on Nov 28, 2023
  2. thoughtfuldata commented on Mar 19, 2024

    @thoughtfuldata

    Added notes on #137 that is still a bug. Sorry for the lateness, as this is a bug that is easily missed/ignored since debugging works through the "Run and Debug" View ( and F5)

  3. Riccardo-Maio commented on May 2, 2024

    @Riccardo-Maio

    I am running into this issue still using VSCode 1.89.0 and Python Debugger v2024.4.0. When specifying a venv path in launch.json using the python key, I get this error:

    Couldn't spawn debuggee: [Errno 13] Permission denied: '/Users/username/dev/path/to/venv/.venv'
    
    Command line:['/Users/username/dev/path/to/venv/.venv', '/Users/username/.vscode/extensions/ms-python.debugpy-2024.4.0-darwin-arm64/bundled/libs/debugpy/adapter/../../debugpy/launcher/../../debugpy', '--connect', '127.0.0.1:65413', '--configure-qt', 'none', '--adapter-access-token', '05382419ede9abcc4130840e65382fc18a1a4ada562a15a13131d3c56c4607be', '/Users/username/dev/path/to/venv/manage.py', 'runserver']
    
  4. sourish-0911 commented on May 15, 2025

    @sourish-0911

    Is there any resolution to the error mentioned by Riccardo Maio (@Riccardo-Maio) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions