Sometimes the code is fine and the editor is the problem. These are the VS Code problems that stop beginners most often, in the order you are likely to meet them.
Every fix here is a one-off — do it once and it stays done.
1. “Python was not found” in the terminal#
You installed Python, it works in a normal Command Prompt, and VS Code says it does not exist.
Restart VS Code completely. The integrated terminal inherits its environment when VS Code launches, so it cannot see a PATH change made after that. Closing the terminal panel is not enough — quit the whole application and reopen it.
If it still fails, the installer never added Python to PATH. Re-run it, choose Modify, and make sure “Add Python to environment variables” is ticked. On Windows you can also try py --version, which usually works even when python does not. Full detail in how to install Python.
2. The run button uses the wrong Python#
Symptoms: a package you definitely installed is “not found”, or IntelliSense underlines things that run perfectly well.
VS Code keeps its own interpreter setting, separate from your terminal. Set it:
- Press Ctrl + Shift + P (Cmd + Shift + P on Mac)
- Type Python: Select Interpreter
- Pick the version you installed
The chosen interpreter then shows in the status bar at the bottom, which is worth glancing at whenever something imports-but-should-not.
3. You opened a file instead of a folder#
This is behind a surprising share of “VS Code is broken” reports. Extensions, the terminal, the debugger and relative file paths all work relative to the folder that is open.
Use File → Open Folder and pick your project folder, not File → Open File. The Explorer panel on the left should show a folder name at the top. If it shows a single lonely file, that is your problem.
4. The terminal is in the wrong directory#
python app.py returns “can’t open file” even though the file is right there in the sidebar.
The terminal has its own current folder, and it does not follow whichever file you have open. Check where you are:
pwd # macOS / Linux / PowerShell
cd # Windows Command Prompt, on its own, prints the folder
cd my-project
python app.pyRight-clicking a folder in the Explorer and choosing “Open in Integrated Terminal” starts you in the right place.
5. Your edits seem to have no effect#
Three causes, in order of likelihood:
- You did not save. An unsaved file shows a dot instead of an X on its tab. Turn on Files: Auto Save →
onFocusChangeand it stops happening. - You are editing one file and running another. Two similarly named files, or a copy in another folder. Add
print("THIS FILE")at the top to confirm which one actually runs. - The browser cached it, for web work. Hard refresh with Ctrl + Shift + R.
6. Live Server does nothing, or fetch fails#
Opening an HTML file by double-clicking gives you an address starting file://. Simple pages work, but fetch requests are blocked, which produces confusing CORS errors on code that is completely correct.
Install the Live Server extension, then right-click your HTML file and choose Open with Live Server. The address becomes http://127.0.0.1:5500 and everything behaves normally. It also reloads the page every time you save.
If the right-click option is missing, the extension did not finish installing — check the Extensions panel and reload the window.
7. Format on save is not formatting#
Two things both have to be true: a formatter is installed for that file type, and VS Code knows which one to use.
- Install Prettier for HTML, CSS and JavaScript
- Turn on Editor: Format On Save in settings
- Press Ctrl + Shift + P → Format Document With… → Configure Default Formatter and pick it
If a file still refuses to format, check the language mode in the bottom-right corner — a file saved without an extension is treated as plain text.
8. Squiggly underlines everywhere#
Yellow and red underlines on code that runs fine usually mean the linter is set stricter than you need while learning, or the interpreter is wrong (see problem 2).
Read one before dismissing them — linters catch real mistakes like unused variables and shadowed names. But if the whole file is underlined, check the interpreter first rather than the code.
9. The integrated terminal will not open#
Press Ctrl and the backtick key (the one above Tab on most layouts) to toggle it. If nothing appears, use Terminal → New Terminal from the menu bar. On Windows, if it opens but immediately closes, your default shell profile may point at something that is not installed — Ctrl + Shift + P → Terminal: Select Default Profile and choose PowerShell.
10. Too many extensions#
Extensions can conflict, slow startup, and fight over formatting. If VS Code has become sluggish or unpredictable, disable everything and re-enable one at a time.
You need very few: the Python extension, Prettier, ESLint, Live Server, and optionally Error Lens. Everything else is preference. The recommended baseline is in VS Code setup for beginners.
Questions people ask#
Should I use the play button or the terminal?
Either. The play button is convenient; the terminal teaches you what is actually happening and is what every guide you read will assume. Learning the terminal version is worth the small effort.
Do I need to reinstall VS Code to fix something?
Almost never. Reloading the window (Ctrl + Shift + P → Developer: Reload Window) clears most odd states, and disabling extensions covers the rest.
Why does my colleague’s setup behave differently?
Settings live in three layers — user, workspace and folder — and a .vscode folder inside a project overrides your personal preferences. That is deliberate, so a team shares formatting rules.
Is VS Code the right editor for a beginner?
It is a reasonable default: free, works on every platform, and handles every language you are likely to touch. PyCharm has deeper Python tooling if you want it. Neither choice will hold you back.
Where to go next#
- VS Code setup for beginners — the settings and extensions worth having
- Why is my Python code not working? — when it really is the code
- How to install Python properly