Skip to content

run selection/line in python terminal not working #21419

Closed as not planned
Closed as not planned

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.79.0
  • OS Version: Windows 10

Steps to Reproduce:

  1. select couple of lines in python file
  2. press SHIFT + ENTER, or right click selection -> Run Python -> run selection/line in python terminal

this started happening after last update.

Activity

  1. pkoprov commented on Jun 9, 2023

    @pkoprov

    I have a similar issue:
    when I press SHIFT + ENTER, or right click selection -> Run Python -> run selection/line in the python terminal it opens 2 terminals named Python, where the first one opens the python terminal (PID 29056) but the second (PID 434444) does not. After that, it tries to execute the highlighted code in the second terminal which obviously is yielding an error.
    If I kill the second Python terminal (PID 434444) and try to run a line of Python again, it opens a new terminal with a new PID and no Python console and behaves exactly like the second one.
    If I kill the first terminal and then run the line it does not create another console, but still not running the code.
    Finally, if I type python in the second console it opens the python terminal, and if I start running line-by-line execution it works.

  2. illmattic-1 commented on Jun 9, 2023

    @illmattic-1

    I have the exact same issue.

    Thank you for providing a work around

  3. luis0283 commented on Jun 9, 2023

    @luis0283

    I have a similar issue: when I press SHIFT + ENTER, or right click selection -> Run Python -> run selection/line in the python terminal it opens 2 terminals named Python, where the first one opens the python terminal (PID 29056) but the second (PID 434444) does not. After that, it tries to execute the highlighted code in the second terminal which obviously is yielding an error. If I kill the second Python terminal (PID 434444) and try to run a line of Python again, it opens a new terminal with a new PID and no Python console and behaves exactly like the second one. If I kill the first terminal and then run the line it does not create another console, but still not running the code. Finally, if I type python in the second console it opens the python terminal, and if I start running line-by-line execution it works.

    The same thing happens to me since yesterday, thank you very much for the solution!!!, and I hope they fix it later.

  4. Beenjamming commented on Jun 9, 2023

    @Beenjamming

    Exact same issue. Workaround also works but didn't have the issue till yesterday.

  5. VincentGurgul commented on Jun 11, 2023

    @VincentGurgul

    Where did this bug suddenly come from? I don't remember installing any updates of VS Code. Does VS Code update automatically in the background? If so, why can't one go back to an older version, like with the extensions, if there is a serious bug like this that isn't being addressed? Makes me want to switch back to vim. 😡

  6. Beenjamming commented on Jun 11, 2023

    @Beenjamming

    Vincent,

    It is still open. I closed my issue as it was a duplicate and linked to this one. You can roll back VS code: https://code.visualstudio.com/updates/v1_78

    I installed the April 2023 release and the issue is not present. You will also need to roll back the python extension. Hope this helps!

  7. VincentGurgul commented on Jun 11, 2023

    @VincentGurgul

    Version 1.78.2 had the same bug for me (Mac silicon / arm64). Had to switch back to 1.77.3, now it is working again. Thanks a lot for the link.

  8. Beenjamming commented on Jun 11, 2023

    @Beenjamming

    Glad 1.77.3 worked! Also wanted to mention that you may need to change your default update settings under your profile settings to prevent auto updates.

  9. VincentGurgul commented on Jun 11, 2023

    @VincentGurgul

    Good point, I just reopened the program and it had automatically reinstalled 1.79.0 ... buuuut: the issue wasn't there 😮 So I checked and I still had the Python extension v2023.8.0 running. Apparently the bug is caused by v2023.10.0!

    So downgrading the Python extension is the solution to the problem.

  10. AyoubAarab commented on Jun 12, 2023

    @AyoubAarab

    Good point, I just reopened the program and it had automaically reinstalled 1.79.0 ... buuuut: the issue wasn't there 😮 So I checked and I still had the Python extension v2023.8.0 running. Apparently the bug is caused by v2023.10.0!

    So downgrading the Python extension is the solution to the problem.

    I have tried this myself and can confirm the issue is caused by the v2023.10.0 of the Python VSCode extension. Downgrading to v2023.8.0 solves the issue.

  11. anthonykim1 commented on Jun 13, 2023

    @anthonykim1

    Duplicate #21393

  12. locked as resolved and limited conversation to collaborators on Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

triage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions