Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command 'python.execInTerminal' not found #22417

Open
jkyeung opened this issue Nov 3, 2023 · 10 comments
Open

command 'python.execInTerminal' not found #22417

jkyeung opened this issue Nov 3, 2023 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@jkyeung
Copy link

jkyeung commented Nov 3, 2023

Type: Bug

Behaviour

Expected vs. Actual

Expected: Pressing the hotkey for "Run Python File in Terminal" runs the Python file in the terminal.

Actual: Get a message that says "command 'python.execInTerminal' not found" and nothing else happens.

Steps to reproduce:

  1. Press the hotkey for "Run Python File in Terminal".

Note that right-clicking the source, then choosing "Run Python > Run Python File in Terminal", appears to do nothing (no error message).

Also note that this used to work fine until recently.

Also note that this issue sounds exactly like #21610 but

  1. nuking the entire VS Code installation, including extensions, and then reinstalling everything is drastic and tedious
  2. uninstalling just the Python-related extensions and reinstalling them, as suggested in a Stack Overflow comment, did not work
  3. issuing the Python: Clear cache and reload window, as suggested in the closed GitHub issue, also did not work
  4. even after taking the nuclear option, it only worked for a short while; a day or so later the issue came back

Potentially relevant to point 4: It's on a work laptop that I use both at home and in the office; in between I put the computer to sleep.

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.11
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): MicrosoftStore
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

terminal
• executeInFileDir: "<placeholder>"

Extension version: 2023.20.0
VS Code version: Code 1.84.0 (d037ac076cee195194f93ce6fe2bdfe2969cc82d, 2023-11-01T11:29:04.398Z)
OS version: Windows_NT x64 10.0.22621
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz (8 x 2208)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 7.77GB (0.82GB free)
Process Argv
Screen Reader no
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 3, 2023
@karthiknadig
Copy link
Member

@jkyeung Please make sure that the python extension is activated. This often means that the extension failed to activate or has not activated. You should be able to see this in the Output > Python logs if there were any issues.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 3, 2023
@jkyeung
Copy link
Author

jkyeung commented Nov 3, 2023

It's activated. I get syntax highlighting and so on. The Python interpreter is listed in the lower right of the status bar. And it does say "This extension is enabled globally".

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Nov 3, 2023
@karthiknadig
Copy link
Member

@jkyeung Do you see any error reported in Developer tools? Help > toggle developer tools

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Nov 3, 2023
@jkyeung
Copy link
Author

jkyeung commented Nov 3, 2023

I don't think so, besides the missing Git warning. Here's a screenshot:

2023-11-03a (VS Code developer tools window)

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Nov 3, 2023
@karrtikr
Copy link

karrtikr commented Nov 6, 2023

Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. Thanks for understanding and the patience!

@skwzrd
Copy link

skwzrd commented Nov 7, 2023

I just came across this issue as well,

Screenshot from 2023-11-06 20-02-08

I was working for me within the past 3 days.

Version: 1.84.1
Commit: 2b35e1e6d88f1ce073683991d1eff5284a32690f
Date: 2023-11-06T12:35:31.181Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.2.0-36-generic snap

@karrtikr
Copy link

karrtikr commented Feb 1, 2024

If the issue is still present, please provide the Python debug logs which can help diagnose it:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Perform steps to reproduce the issue
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 1, 2024
@jkyeung
Copy link
Author

jkyeung commented Feb 1, 2024

OK, see attached.

2024-02-01a (Python output in VS Code).txt

The line that was timestamped 2024-02-01 14:31:29.332 was on the screen when I pressed F5 (which I have defined as "python.execInTerminal"). Other than the "command 'python.execInTerminal' not found" message, nothing seemed to happen. Then a few moments later, the line timestamped 2024-02-01 14:32:08.115 showed up.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 1, 2024
@karrtikr karrtikr assigned karthiknadig and unassigned karrtikr Mar 28, 2024
@aschuh-hf
Copy link

I just ran into the same error message and thought I'd post what the issue was for me. I had opened a Workspace which was not trusted yet, and thus opened in "Restricted Mode". Clicking "Restricted Mode" in the status bar and selecting "Trust" author resolved the issue for me.

@santi-souza
Copy link

I´m having the same problem in MAC. If i use the Run display from VSCode no problem, but if I run with SHIFT + RETURN the same problem shows up.

VSCode Run python file:
image

SHIFT + RETURN
image

@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

7 participants
@karthiknadig @jkyeung @karrtikr @skwzrd @aschuh-hf @santi-souza and others