Reputation: 91
I accidentally deleted python, then when I reinstalled it, VS Code kept showing me an error saying
You need to select a Python Interpreter before you start debugging. Tip: click on "Select Python Interpreter" in the status bar."
When I go to the bar there are no interpreters available. When I try on someone else's laptop it shows the interpreters.
Python is already in the PATH.
Upvotes: 9
Views: 77100
Reputation: 18069
Selecting Python interpreter (bottom right of screen) and selecting test framework (unittest/pytest) from VSC settings, then closing VSC and reopening it solved the problem for me.
Upvotes: 0
Reputation: 11
I was unable to select the Python: Select Interpreter
.
It was solved instead by disabling the python debugger extension, then disabling and re-enabling the python extension.
After that I could follow the steps in Mia's answer.
Upvotes: 1
Reputation: 1
I completely uninstalled my python and re-installed the latest version (which currently is 3.9.6), and it perfectly worked.
Upvotes: 0
Reputation: 11
I uninstalled the latest Python version (ex. v3.10.2) and re-installed an older version (ex. v3.9.7), and it's working perfectly without no issues.
Upvotes: -1
Reputation: 1
I had to do the following and it worked:
Upvotes: 0
Reputation: 111
Check whether you have the Python extension installed in your Visual Studio Code. If it is already installed, then try to disable/enable it.
Upvotes: 6
Reputation: 366
You should find and choose python interpreter manually:
Ctrl+Shift+P, Python: Select Interpreter
Find your python.exe in your python installation path, the default path is like:
C:\Users\***\AppData\Local\Programs\Python\Python37
Check if the problem is solved
OR you can take the following steps to override settings for interpreter
Ctrl+Shift+P, Preferences: Open Settings(JSON)
Copy your python path
Add line like this, paste and replace the path:
"python.pythonPath": "C:\\Users\\***\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe"
Ctrl+S to save the changes.
See more for macOS/Linux:
https://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter
Upvotes: 11