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

python is not running #228081

Open
GauravNegi2 opened this issue Sep 10, 2024 · 22 comments
Open

python is not running #228081

GauravNegi2 opened this issue Sep 10, 2024 · 22 comments
Assignees

Comments

@GauravNegi2
Copy link

Type: Performance Issue

after a loop of reactivating terminal problem when it got fixed then my python code runner stopped working and shift+enter is also not working for the same

VS Code version: Code 1.93.0 (4849ca9, 2024-09-04T13:02:38.431Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz (8 x 2496)
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 23.91GB (19.33GB free)
Process Argv --crash-reporter-id d29636b5-32d9-42da-b2ae-7f789dcb9df7
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    1	   108	  6376	code main
    0	    81	  2172	fileWatcher [1]
    1	    92	  2488	   gpu-process
    0	    39	  3280	   utility-network-service
    0	    26	  6664	   crashpad-handler
    0	    99	  8320	ptyHost
    0	     6	  7880	     conpty-agent
    0	    73	  9108	     C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\grimd\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1\" } catch {}"
    0	     6	 12408	     conpty-agent
    0	    74	 15696	     C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\grimd\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\browser\media\shellIntegration.ps1\" } catch {}"
    0	   115	 11624	shared-process
    3	   231	 13352	window [1] (fifth_gauravnegi.py - DSA - Visual Studio Code)
    0	   219	 15680	extensionHost [1]
    0	     6	 14352	     c:\Users\grimd\.vscode\extensions\ms-python.python-2024.14.0-win32-x64\python-env-tools\bin\pet.exe server
    0	    11	  6216	       C:\Windows\system32\conhost.exe 0x4
    0	    86	 16208	     "C:\Users\grimd\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\grimd\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\node\jsonServerMain" --node-ipc --clientProcessId=15680
Workspace Info
|  Window (fifth_gauravnegi.py - DSA - Visual Studio Code)
|    Folder (DSA): 17 files
|      File types: py(15) json(1)
|      Conf files: settings.json(1);
Extensions (18)
Extension Author (truncated) Version
classroom git 0.0.4
vscode-pull-request-github Git 0.96.0
debugpy ms- 2024.10.0
python ms- 2024.14.0
vscode-pylance ms- 2024.9.1
jupyter ms- 2024.8.1
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.19
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
cmake-tools ms- 1.19.51
cpptools ms- 1.21.6
cpptools-extension-pack ms- 1.3.0
vsliveshare ms- 1.0.5936
open-in-browser tec 2.0.0
cmake twx 0.0.17
classroomplugin Whi 1.0.8
chat-gpt zha 1.8.4

(3 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
9c06g630:31013171
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
impr_priority:31102340
refactort:31108082
pythonrstrctxt:31112756
flightc:31134773
wkspc-onlycs-t:31132770
nativeloc1:31134641
wkspc-ranged-t:31125599
cf971741:31134768
fje88620:31121564

@dshammers
Copy link

I'm having the same issue and mine also started on August 9th, 2024. I was able to solve the reactivating terminals loop by using Python: Clear Cache and Reload Window, but now VSCode won't connect to the kernel at all. My Jupyter and regular Python files won't execute, and I know the interpreter works just fine because I can open IDLE and run code with no issue. I've tried reinstalling the kernel, VSCode, and every relevant extension within VSCode and nothing has resolved the issue so far. VSCode clearly sees the global interpreter, but it's not able to execute the code for some reason.

@GauravNegi2
Copy link
Author

I'm having the same issue and mine also started on August 9th, 2024. I was able to solve the reactivating terminals loop by using Python: Clear Cache and Reload Window, but now VSCode won't connect to the kernel at all. My Jupyter and regular Python files won't execute, and I know the interpreter works just fine because I can open IDLE and run code with no issue. I've tried reinstalling the kernel, VSCode, and every relevant extension within VSCode and nothing has resolved the issue so far. VSCode clearly sees the global interpreter, but it's not able to execute the code for some reason.

any solutions?

@dshammers
Copy link

My current solution has been to uninstall VSCode and switch to PyCharm. I figure it's a Microsoft issue, and I don't want to not code while I wait for them to figure out a solution.

@dshammers
Copy link

Update: VSCode on my work computer is running fine, and that's after the 1.93 update. Python 3.12.3 still works there, whereas both it and 3.12.6 both don't connect on my home computer.

@GauravNegi2
Copy link
Author

Update: VSCode on my work computer is running fine, and that's after the 1.93 update. Python 3.12.3 still works there, whereas both it and 3.12.6 both don't connect on my home computer.

what changed mine still isnt working with python and i noticed that python terminal is also not opening in the visual studio.

@dshammers
Copy link

Have you tried opening IDLE to confirm the interpreter still works? I did on mine, and it did.

@GauravNegi2
Copy link
Author

Have you tried opening IDLE to confirm the interpreter still works? I did on mine, and it did.

IDLE is working

@dshammers
Copy link

PyCharm works on mine, so the interpreter is still functional. Is there any other testing we can do to the extensions? I tried disabling or reinstalling them, but that didn't fix anything.

@GauravNegi2
Copy link
Author

PyCharm works on mine, so the interpreter is still functional. Is there any other testing we can do to the extensions? I tried disabling or reinstalling them, but that didn't fix anything.

i tried reinstalling everthing that includes python,visual studio,extensions but when i try to run python in visual studios,even F5 doesnt run it.

@dshammers
Copy link

Same with me. I'm stuck wondering why it still runs fine on my work computer but not my home computer. They're both up to date Windows systems.

@GauravNegi2
Copy link
Author

Same with me. I'm stuck wondering why it still runs fine on my work computer but not my home computer. They're both up to date Windows systems.

I deleted visual studio also its hidden file and then restarted the laptop,then dowloaded visual studio fresh and now it works

@dshammers
Copy link

Interesting. Where's the hidden file?

@GauravNegi2
Copy link
Author

Interesting. Where's the hidden file?

there are two one code file and one .vscode file you can refer to any deep removal of visual studio files in youtube

@ShampooDeng
Copy link

Same with me. I'm stuck wondering why it still runs fine on my work computer but not my home computer. They're both up to date Windows systems.

I deleted visual studio also its hidden file and then restarted the laptop,then dowloaded visual studio fresh and now it works

This doesn't works for me :(
My way is switching back to version 1.92.2, the latest version of July's update. After that, it works again even with the latest python extensions.

@anthonykim1
Copy link
Contributor

anthonykim1 commented Sep 13, 2024

Thanks for filing issue @GauravNegi2 @ShampooDeng Does updating to latest vscode and latest python extension (2024.14.1) work? Make sure to restart and run "Python Clear Cache and Reload" via command palette (control/cmd + shift + enter)

@ShampooDeng
Copy link

Thanks for filing issue @GauravNegi2 @ShampooDeng Does updating to latest vscode and latest python extension (2024.14.1) work? Make sure to restart and run "Python Clear Cache and Reload" via command palette (control/cmd + shift + enter)

No, it doesn't work. I updated to vscode 1.93.1 and python extension 2024.14.1, and run "Python Clear Cache and Reload window)". Still, there is no python environment indicator at the bottom stattus line, no autocompletion, and selecting other python interpreter via "Select Interpreter" doesn't do anything. When it comes to Jupyter files and python files execution, my symptoms are the same as dshammers has described.

@dshammers
Copy link

I wanted to add that deleting both the Code and .vscode files for me also did not resolve the issue.

@ShampooDeng
Copy link

ShampooDeng commented Sep 18, 2024

Thanks for filing issue @GauravNegi2 @ShampooDeng Does updating to latest vscode and latest python extension (2024.14.1) work? Make sure to restart and run "Python Clear Cache and Reload" via command palette (control/cmd + shift + enter)

No, it doesn't work. I updated to vscode 1.93.1 and python extension 2024.14.1, and run "Python Clear Cache and Reload window)". Still, there is no python environment indicator at the bottom stattus line, no autocompletion, and selecting other python interpreter via "Select Interpreter" doesn't do anything. When it comes to Jupyter files and python files execution, my symptoms are the same as dshammers has described.

I think I fixed it by changing the Python: Locator from 'native' to 'js' in my setting, following a solution provided in this issue. Now vscode-python:v2024.14.1 is working fine on vscode:1.93.1.

@dshammers
Copy link

That seems to have fixed it for me, too. Did the update to vscode: 1.93.1 mess up the kernel detection?

@anthonykim1
Copy link
Contributor

anthonykim1 commented Oct 28, 2024

Sorry folks for late update, but glad you guys found a workaround via switching locator to js.
This shouldnt be related to the vscode version itself but rather Python extension version. Give the latest pre-release version of the Python extension a try.
Are you guys also on conda environment?

@dshammers
Copy link

Sorry folks for late update, but glad you guys found a workaround via switching locator to js. This shouldnt be related to the vscode version itself but rather Python extension version. Give the latest pre-release version of the Python extension a try. Are you guys also on conda environment?

I'm not. I don't use conda.

@ShampooDeng
Copy link

Sorry folks for late update, but glad you guys found a workaround via switching locator to js. This shouldnt be related to the vscode version itself but rather Python extension version. Give the latest pre-release version of the Python extension a try. Are you guys also on conda environment?

I'm on conda 24.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants