Skip to content

Python file now runs slowly #1830

Description

@Serofa20125

The code now runs slowly with this extension; when I click the "Run" button, it takes 5 seconds to start, and the command launching the code—along with the result—only appears after a 5-second delay. Without this extension, the code runs as usual—very quickly

Activity

  1. Xenakios commented on Sep 26, 2026

    @Xenakios

    The code now runs slowly with this extension; when I click the "Run" button, it takes 5 minutes to start, and the command launching the code—along with the result—only appears after a 5-second delay. Without this extension, the code runs as usual—very quickly

    I was getting about a 5 second delay after pressing the "Run" button before the Python script actually started running. Downgrading the extension to version 1.36.0 seemed to solve the issue.

  2. StellaHuang95 commented on Sep 28, 2026

    @StellaHuang95
    Contributor

    This looks like a regression introduced by #1741, which added a wait for VS Code’s shell integration before sending a Python command to the terminal. The Run button uses this same execution path, so if shell integration is unavailable and no new terminal prompt output is detected, it waits for the default five-second timeout before launching the script. This wait can repeat even when reusing an existing terminal, explaining the delay before the command and its output appear rather than slower execution of the Python code itself. Downgrading to 1.36.0 removes this added wait, which makes that change a strong suspect.

  3. edvilme commented on Sep 30, 2026

    @edvilme
    Contributor

    Hello, thanks for bringing this to our attention. To help narrow down the delay, could you please tell us:

    • What OS and terminal shell (bash, zsh, fish) are you using?
    • Is terminal.integrated.shellIntegration.enabled, and have you customized terminal.integrated.shellIntegration.timeout?
    • Does the delay happen only on the first run in a new terminal, or does it happen for every run in the same terminal?
  4. sable2100 commented on Oct 2, 2026

    @sable2100

    Hello, Just wanted to add my findings to the issue as well.

    With the Python Environments extension installed, opening a new integrated terminal took about five seconds. Clicking Run Python File had the same delay before the terminal appeared. This happened with both PowerShell and Command Prompt. After uninstalling Python Environments, terminal startup and running the file were immediate.

    The integrated terminal should open promptly; running a Python file should not incur a multi-second delay before the terminal appears.

    Uninstalling python-environments returns everything to normal.

  5. CarterSwinney commented on Oct 7, 2026

    @CarterSwinney

    For now, I found a solution:

    1. Open PowerShell as Administrator
    2. Run this code: "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine"

    It worked for me; I'm not sure about others, but it's worth mentioning! :D

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions