I've been trying to setup my python workspace on vscode but the software doesn't seem to pick up the fact that I have python installed, and keeps telling me to install python. I've tried manually adding the path of the .exe file but the "invalid interpreter prompt" shows up every single time. Just for proof of me having the correct path in the settings here's a screenshot of the .json file and the command prompts I used to obtain the path.
-
Maybe try restarting VS Code (from the command palette) or your computer? Also, VS Code might not have permissions to access/run that executable, so make sure to run it as an administrator. – abnathan Aug 06 '22 at 22:26
-
I tried reinstalling both vscode and python through the instructions from the command palette, and ran vscode as administrator but nothing made a difference. I added the python.exe file location to PATH as well – J930911 Aug 07 '22 at 09:54
-
2I'm having the same problem here after I upgraded my python to 3.10.6 (LATEST at the time of writing). VS Code is reporting `An Invalid Python interpreter is selected, please try changing it to enable features such as IntelliSense, linting, and debugging.` and not accepting any virtual envs created with this version of python. – Wesley Cheek Aug 08 '22 at 00:57
-
Same for me, I even tried installing older (3.9/3.8) python versions and it still comes up with the same message. I'm wondering if the extension is running some python code (eg to get version etc) and getting an unexpected response?. – Giles Aug 09 '22 at 12:44
-
Is there any progress on the issue? – JialeDu Aug 10 '22 at 08:15
-
I ended up downgrading the VS Code Python extension to v10.1 (from v12.0) and it seems to have fixed the problem with the warning popup, but when I try to use Jupyter it's still telling me that python is not installed.. – Wesley Cheek Aug 17 '22 at 02:20
8 Answers
On my device (VSCode 1.71.2, Python extension 2022.14.0) I could solve the problem by clearing the python interpreter setting.
For this, use Ctrl+Shift+P to open the command palette. Then, enter Python: Clear Workspace Interpreter Setting
. On the next panel, select to delete all.
After this, you should be able to select an interpreter by entering Python:Select Interpreter
in the command palette.

- 2,481
- 2
- 15
- 31
-
this solved my problem, but I still don't understand why... could you provide further explanation of what happened under the hood? At first, I thought I was having problems with PATH, but now I am even more confused. – Álvaro A. Gutiérrez-Vargas Oct 17 '22 at 18:07
-
1On newer versions of VSCode, this is now called "Python: Clear Cache and Reload Windows" – jraufeisen Mar 15 '23 at 21:40
First, make sure you have the python extension installed.
Then follow the steps below to choose an interpreter for vscode:
Use Ctrl+Shift+P to open the command palette
search for
Python:Select Interpreter
(or click select interpreter in the lower right corner)If the panel shows an interpreter, select the available interpreter. If the panel doesn't have an interpreter option. Please select the first item
Enter interpreter path
Then paste the full path to your
python.exe
(or go to explorer by selectingFind
and select yourpython.exe
)
If it still fails, try installing the pre-release python extension.

- 6,021
- 2
- 5
- 24
-
5Tried all of this, including the pre-release version of the python extension. Still no luck. – Wesley Cheek Aug 17 '22 at 00:23
-
1i did exactly these steps this morning and it worked for me. it found the three different python executables in my path. not sure if i restarted vscode after. i think so - after all, it is a microsoft product. – keithpjolley Aug 18 '22 at 01:57
For me, after investigating the problem in this issue, I found that the problem had to do with my ComSpec
environment variable. This environment variable needs to be set to C:\Windows\system32\cmd.exe
for the python extension to work.
Make sure to restart after changing the environment variable for changes to take effect

- 3
- 1

- 1,058
- 12
- 22
-
I had lost hope but as a final resort, I tried this and it worked for me – Alireza Samadi Jan 10 '23 at 10:10
-
this one fixed the problem for me, as i have in the past changed the ComSpec trying to experiment with windows terminal commands – R3-da Apr 17 '23 at 13:57
I tried all the suggestions above, none worked. I even tried reinstalling it, no luck.
What worked was downgrading to the previous version (in my case v2022.12.1
) of the Python vscode extension then upgrading to the latest (which was v2022.12.1
).

- 1,337
- 23
- 34
Running VS Code as administrator helped with solving the invalid python interpreter problem.
what fixed it for me was going to settings -> search "inherit env" and disable it.
(macos)

- 1
Remove any blank spaces in your folder path. For me, this solved the problem.

- 25,369
- 29
- 96
- 135

- 11
- 2