pythonvisual-studio-codepython-3.13

How can I fix the Python REPL in VS Code with Python 3.13?


I'm having trouble sending code in Python file to the interactive REPL in VS Code (using Shift + Enter).

Single line code and functions with one line work fine, but any code chunks with multiple lines raise IndentationErrors. Also KeyboardInterrupt shows up in the REPL every time code is sent.

Tried updating and restarting VS Code and the Python Extension.

Python 3.13 REPL


Solution

  • It's a known issue:

    https://github.com/microsoft/vscode-python/issues/24256

    Yes, that KeyboardInterrupt is handled via #24422

    So you give it a try tomorrow (it just got merged today Nov 12), and it wont be there!

    So apparently it will be fixed in the next vscode-python build (v2024.20.0 is currently the latest).