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

"An Invalid Python interpreter is selected" #21695

Closed
madmarcin33 opened this issue Jul 25, 2023 · 11 comments
Closed

"An Invalid Python interpreter is selected" #21695

madmarcin33 opened this issue Jul 25, 2023 · 11 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@madmarcin33
Copy link

madmarcin33 commented Jul 25, 2023

Type: Bug

Install python 3.11.4
VS Code 1.80.1
Uninstall python
Install Python Extension v2023.12.0
Install python 3.11.4 again

This is my first time trying to learn coding/programming and downloading VScode and Python. When i saw that there is Python to download in VScode I thought that then it is not necessary to have Python installed on windows so I uninstalled it. Then when I tried to run test python file, Python in VScode turned out to be only extension so I installed Python on windows again. I again tried to run test file but error poped up "An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging. ".

image
image
image
image


Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)


2023-07-26 00:43:32.287 [info] Experiment 'pythonPromptNewFormatterExt' is active
2023-07-26 00:43:32.288 [info] Experiment 'pythonPromptNewToolsExt' is active
2023-07-26 00:43:32.288 [info] Experiment 'pythonSurveyNotification' is active
2023-07-26 00:43:32.288 [info] Test server listening.
2023-07-26 00:43:32.288 [info] > conda info --json
2023-07-26 00:43:32.333 [info] > ~\AppData\Local\Programs\Python\Python311\python.exe -I ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
2023-07-26 00:43:32.343 [info] > ~\AppData\Local\Programs\Python\Python311\pythonw.exe -I ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
2023-07-26 00:43:32.412 [error] [Error: Command failed: c:\Users\o^\AppData\Local\Programs\Python\Python311\pythonw.exe -I c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
System nie mo�e odnale�� okre�lonej �cie�ki.

	at ChildProcess.exithandler (node:child_process:409:12)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1121:16)
	at Socket.<anonymous> (node:internal/child_process:479:11)
	at Socket.emit (node:events:513:28)
	at Pipe.<anonymous> (node:net:757:14)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'c:\\Users\\o^\\AppData\\Local\\Programs\\Python\\Python311\\pythonw.exe -I c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\get_output_via_markers.py c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\interpreterInfo.py'
}
2023-07-26 00:43:32.413 [error] [Error: Command failed: C:\Users\o^\AppData\Local\Programs\Python\Python311\python.exe -I c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
System nie mo�e odnale�� okre�lonej �cie�ki.

	at ChildProcess.exithandler (node:child_process:409:12)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1121:16)
	at Socket.<anonymous> (node:internal/child_process:479:11)
	at Socket.emit (node:events:513:28)
	at Pipe.<anonymous> (node:net:757:14)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'C:\\Users\\o^\\AppData\\Local\\Programs\\Python\\Python311\\python.exe -I c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\get_output_via_markers.py c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\interpreterInfo.py'
}
2023-07-26 00:43:32.428 [info] > ~\AppData\Local\Microsoft\WindowsApps\python3.11.exe -I ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
2023-07-26 00:43:32.470 [error] [Error: Command failed: C:\Users\o^\AppData\Local\Microsoft\WindowsApps\python3.11.exe -I c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
System nie mo�e odnale�� okre�lonej �cie�ki.

	at ChildProcess.exithandler (node:child_process:409:12)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1121:16)
	at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'C:\\Users\\o^\\AppData\\Local\\Microsoft\\WindowsApps\\python3.11.exe -I c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\get_output_via_markers.py c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\interpreterInfo.py'
}
2023-07-26 00:43:34.425 [info] > ~\AppData\Local\Programs\Python\Python311\pythonw.exe -I ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
2023-07-26 00:43:34.430 [info] > ~\AppData\Local\Programs\Python\Python311\python.exe -I ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
2023-07-26 00:43:34.453 [error] [Error: Command failed: c:\Users\o^\AppData\Local\Programs\Python\Python311\pythonw.exe -I c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
System nie mo�e odnale�� okre�lonej �cie�ki.

	at ChildProcess.exithandler (node:child_process:409:12)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1121:16)
	at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'c:\\Users\\o^\\AppData\\Local\\Programs\\Python\\Python311\\pythonw.exe -I c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\get_output_via_markers.py c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\interpreterInfo.py'
}
2023-07-26 00:43:34.458 [error] [Error: Command failed: C:\Users\o^\AppData\Local\Programs\Python\Python311\python.exe -I c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
System nie mo�e odnale�� okre�lonej �cie�ki.

	at ChildProcess.exithandler (node:child_process:409:12)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1121:16)
	at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'C:\\Users\\o^\\AppData\\Local\\Programs\\Python\\Python311\\python.exe -I c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\get_output_via_markers.py c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\interpreterInfo.py'
}
2023-07-26 00:43:34.476 [info] > ~\AppData\Local\Microsoft\WindowsApps\python3.11.exe -I ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
2023-07-26 00:43:34.504 [error] [Error: Command failed: C:\Users\o^\AppData\Local\Microsoft\WindowsApps\python3.11.exe -I c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py c:\Users\o^\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py
System nie mo�e odnale�� okre�lonej �cie�ki.

	at ChildProcess.exithandler (node:child_process:409:12)
	at ChildProcess.emit (node:events:513:28)
	at maybeClose (node:internal/child_process:1121:16)
	at ChildProcess._handle.onexit (node:internal/child_process:304:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'C:\\Users\\o^\\AppData\\Local\\Microsoft\\WindowsApps\\python3.11.exe -I c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\get_output_via_markers.py c:\\Users\\o^\\.vscode\\extensions\\ms-python.python-2023.12.0\\pythonFiles\\interpreterInfo.py'
}
2023-07-26 00:43:35.732 [info] Starting Pylance language server.
2023-07-26 00:43:35.750 [info] > ~\AppData\Local\Programs\Python\Python311\pythonw.exe -c "import sys;print(sys.executable)"



What I tried:
-running vscode as an admin
-reinstalling python and vscode
-moving %SystemRoot%\system32 to the top of system variables path list
-switching to pre-release version of an extension
-manually selecting interpreter

Results:
-it still doesn't work
Expected results:
-it works how it should

Extension version: 2023.12.0
VS Code version: Code 1.80.1 (74f6148eb9ea00507ec113ec51c489d6ffb4b771, 2023-07-12T17:22:07.651Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs AMD Ryzen 5 2600X Six-Core Processor (12 x 3593)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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) 15.93GB (12.40GB free)
Process Argv --crash-reporter-id c433a643-5c66-4a18-9f45-0286bb6c5e3d
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30610679
2e4cg342:30602488
f6dab269:30613381
vscrp:30673768
showlangstatbar:30737416
vsctsb:30748421
03d35959:30757346
57b77579:30736110
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
showindicator:30785052
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonnoceb:30797650
e537b577:30795824
dsvsc013:30795093
dsvsc014:30797589
cmakestatusbarv2:30779594

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jul 25, 2023
@karthiknadig
Copy link
Member

@madmarcin33 Click on the yellow "select interpreter" on the status bar in your screen shot:
image

Then pick a python from the list:
image

@madmarcin33
Copy link
Author

image
no option works

@madmarcin33
Copy link
Author

madmarcin33 commented Jul 26, 2023

I tried downloading python from windows store now, but when i try to choose file in the same localization as on your screenshot it doesn't work too.
image
image
it says that the system cannot access the file

@karrtikr
Copy link

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!

@karrtikr
Copy link

karrtikr commented Jul 27, 2023

@madmarcin33 Can you demonstrate to me that any of pythons work outside of VSCode? For eg. try running:

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps\python3.11.exe -I %USERPROFILE%\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py

outside VS Code in Command prompt.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 27, 2023
@karrtikr
Copy link

Also, note pythonw.exe is not a valid Python binary, so selecting it would not work.

@madmarcin33
Copy link
Author

@madmarcin33 Can you demonstrate to me that any of pythons work outside of VSCode? For eg. try running:

%USERPROFILE%\AppData\Local\Microsoft\WindowsApps\python3.11.exe -I %USERPROFILE%\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2023.12.0\pythonFiles\interpreterInfo.py

outside VS Code in Command prompt.

image
"the system could not find the specified path"

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

In that case this seems like this is not an issue of VS Code, so I will have to close this issue. I encourage you to ask this question in stack overflow or https://chat.openai.com/ to figure out what's wrong with the Python installs in your system.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jul 27, 2023
@madmarcin33
Copy link
Author

but python works correctly
image

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jul 28, 2023
@madmarcin33
Copy link
Author

I installed Code Runer instead of extension that vscode recommends and now everything works correctly, thanks for not helping me out

@malangston
Copy link

@madmarcin33 In-case it's helpful for you or others who stumble upon this issue: I saw a this with similar results/output running almost the same versions of the software. Turns out it was our anti-virus (sentinel one). 😭

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants