Python debugger doesn't launch

The reason seems below:

I took @DanS lead to get it to work.
Fix for Cursor IDE Python Debugger on Windows

(I;m on Windows using git bash)

Problem: Python debugger immediately stops in Cursor IDE
Solution: Copy debugpy files to the correct location

Definitions:

  • Python extension (ms-python.python-*): The main Python extension that provides Python language support,
    including IntelliSense, linting, debugging, code navigation, code formatting, refactoring, etc.
  • Debugpy extension (ms-python.debugpy-*): A debug adapter that enables debugging Python code

Steps (using Git Bash):

  1. Find your debugpy version:
    ls “/c/Users/$USERNAME/.cursor/extensions” | grep “debugpy”
    Example output: ms-python.debugpy-2024.6.0-win32-x64

  2. Find your Python extension version:
    ls “/c/Users/$USERNAME/.cursor/extensions” | grep “python-”
    Example output: ms-python.python-2024.5.1-universal

  3. Create the required directory:
    mkdir -p “/c/Users/$USERNAME/.cursor/extensions/ms-python.python-2024.5.1-universal/pythonFiles/lib/python/debugpy”

  4. Copy the debugpy files:
    cp -r “/c/Users/$USERNAME/.cursor/extensions/ms-python.debugpy-2024.6.0-win32-x64/bundled/libs/debugpy/”* “/c/Users/$USERNAME/.cursor/extensions/ms-python.python-2024.5.1-universal/pythonFiles/lib/python/debugpy/”

Notes:

  • Replace $USERNAME with your Windows username
  • Make sure you’re using Git Bash (MINGW64)
  • The versions will be different (like python-2024.5.1 and debugpy-2024.6.0) - this is normal
2 Likes

Thanks DanS and HappyDay this did indeed work. here are simple instructions for Windows:

Step 1: Find Your debugpy Version

  1. Open File Explorer.
  2. Navigate to the following folder:
C:\Users\<Your Windows Username>\.cursor\extensions
  1. Look for a folder name that starts with ms-python.debugpy. Note the exact name (e.g., ms-python.debugpy-2024.6.0-win32-x64).

Step 2: Find Your Python Extension Version

  1. While still in the extensions folder, look for a folder name that starts with ms-python.python. Note the exact name (e.g., ms-python.python-2024.5.1-universal).

Step 3: Create the Required Directory

  1. Go into the Python extension folder you identified (e.g., ms-python.python-2024.5.1-universal).
  2. Navigate to:
pythonFiles\lib\python
  1. If a folder named debugpy does not exist inside pythonFiles\lib\python, create it:
  • Right-click inside the folder, select New > Folder, and name the folder debugpy.

Step 4: Copy the debugpy Files

  1. Go back to the ms-python.debugpy folder you identified earlier (e.g., ms-python.debugpy-2024.6.0-win32-x64).
  2. Navigate to:
bundled\libs\debugpy
  1. Select all the files and folders inside the debugpy folder.
  • Press Ctrl+A to select all.
  • Right-click and choose Copy.
  1. Go back to the debugpy folder you created earlier inside the Python extension folder (e.g., ms-python.python-2024.5.1-universal\pythonFiles\lib\python\debugpy).
  2. Right-click inside the folder and choose Paste.

Great. Although do you feel us fixing an important bug that has been ignored by the Cursor team which closed a Series A round in August 2024, bringing in $60 million co-led by Andreessen Horowitz and Thrive Capital, with participation from other notable investors including Patrick Collison (co-founder and CEO of Stripe), OpenAI Startup Fund, and Jeff Dean (Google’s Chief Scientist)? It seems VC funded companies want not only our money but the “Open Source” ability to fix their bugs. Frustrating.

One more development - this happened on my laptop, too. There was no directory:
ms-python.debugpy
I had to install vscode, then look in c:\user%username%.vscode in order to find the files to copy over.

+1 one this, I can run test, but was never able to Debug Test, it will keep hanging and cannot be interrupted, unless I restart Cursor

Having the same issue here.

Version: 0.44.11
VSCode Version: 1.93.1
Commit: fe574d0820377383143b2ea26aa6ae28b3425220
Date: 2025-01-03T07:59:06.361Z
Electron: 30.5.1
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin x64 22.5.0

I had to install the “Python Debugger” extension in addition to the “Python” extension (both are named ms-python in the extensions manager) and select “Python Debugger: Python File” in the “Run and Debug” window instead of the default “Python: Current File”. I don’t think this is a fix for whatever debugger is in the “A Cursor extension with rich support…” version of ms-python “Python” extension, as “Python Debugger” extension says it is for VS Code (but works in Cursor whereas the other one does not).

For me, 4.5.4 fixed it

I just started having this problem after updating to cursor 0.46.0 on Ubuntu. Nothing happens when I try to launch the python debugger on any python project.

I fixed with latest update.

Version: 0.45.14
VSCode Version: 1.96.2
Commit: 906121b8c0bdf041c14a15dac228e66ab5505260
Date: 2025-02-19T20:36:48.096Z
Electron: 32.2.6
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100

I am happy for you. For me, this has been going on for a long time. I do not understand why the team has been ignoring this.

1 Like

In the cursor settings, enter
python for the Default Interpreter Path, and Run and Debug should work properly.

Changing the “type” from “python” to “debugpy” fixed it for me:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true
        }
    ]
}

to

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true
        }
    ]
}
2 Likes

It only works for me when I change “console” to “internalConsole”.

{
      "name": "Python Debugger: Django",
      "type": "debugpy",
      "request": "launch",
      "program": "${workspaceFolder}/src/manage.py",
      "args": [
        "runserver",
        "127.0.0.1:8000",
      ],
      "django": true,
      "justMyCode": false,
      "autoStartBrowser": false,
      "console": "internalConsole",
      "python": "${workspaceFolder}/venv/bin/python",
      "env": {
        "DJANGO_SETTINGS_MODULE": "core.settings",
        "PYTHONPATH": "${workspaceFolder}"
      }
    }

The problem in test plugin path resolver.
Fix for Ubuntu pytest debugging:
Copy files (not folder!) from $HOME/.cursor/extensions/ms-python.debugpy-2024.6.0-linux-x64/bundled/libs to $HOME/.cursor/extensions/ms-python.python-2024.5.1-universal/pythonFiles/lib/python

like this:

paths maybe different, look into ide code Output: Python Debbuger Tab errors.

Having this problem too. None of the above solutions worked for me.

This fix worked for me in Cursor Version: 0.47.8

Having this problem too. In cursor python debug not work, but in vscode it works.

Version: 0.48.7 (Universal)
VSCode Version: 1.96.2
Commit: 1d623c4cc1d3bb6e0fe4f1d5434b47b958b05870
Date: 2025-04-02T04:51:59.792Z
Electron: 34.3.4
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.3.0