What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

When VS Code’s terminal and IntelliSense appear to use different Python versions, check them as separate contexts: the workspace’s selected interpreter, the Python executable resolved by the terminal shell, and—if debugging alone differs—the interpreter configured in launch.json. Select the intended environment, open a fresh terminal, verify its Python path, then investigate Pylance search paths or debugger settings only if the mismatch remains.

Why the terminal and IntelliSense can disagree

VS Code’s selected Python environment is the baseline for running code, debugging, and language features such as IntelliSense. You can see the selected Python version in the status bar and change it with Python: Select Interpreter. However, an integrated terminal is a separate shell process: its active environment depends on terminal activation settings and the shell’s current state. Debugging can also use a different interpreter if the active launch.json configuration overrides the default.

Pylance is VS Code’s default Python language server. It analyzes imports using the selected environment and recognized import locations; it may flag a package installed elsewhere, or one stored outside standard search locations. See Microsoft’s Python environments documentation and Python editing documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Diagnose the mismatch in order

1. Select the project environment

  1. Open the Command Palette and run Python: Select Interpreter, or click the Python version in the status bar.
  2. Choose the environment intended for this project, such as its workspace-local .venv or venv.
  3. If the intended environment is missing, check whether its location is covered by environment discovery paths or whether the environment needs repair. VS Code’s default auto-selection order favors workspace-local .venv and venv environments over global or system interpreters when you have not explicitly selected an environment.

Microsoft describes the selected environment as the one used for running code, debugging, and language features such as IntelliSense. That does not guarantee that an already-open shell has switched environments or that a custom debugger configuration has no override.

2. Open a fresh terminal and check its Python

Create a new integrated terminal after selecting the environment. In that terminal, check which executable the shell resolves and its version:

  • On many macOS and Linux shells: which python, then python --version.
  • On Windows: where python, then python --version.

Compare the reported executable with the environment you selected. These commands inspect the shell’s resolution; they are diagnostic checks, not a guarantee that every shell uses the same command or path behavior. If the path points elsewhere, activate the intended environment or use the environment-specific terminal workflow before installing packages or running shell commands.

3. Check terminal activation settings

VS Code’s current Python settings reference documents python-envs.terminal.autoActivationType, with values command, shellStartup, and off. When this setting is configured, it takes precedence over the older python.terminal.activateEnvironment setting. The older setting’s documented default is true, but that default does not override the newer setting.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Review the terminal activation setting if a newly created terminal does not activate the selected environment. After changing activation settings, close and recreate the terminal: an existing shell may retain its earlier state. See Microsoft’s Python settings reference.

4. Match package installation to Pylance’s environment

If a program runs in the terminal but Pylance reports an unresolved import, confirm that the terminal’s Python and the selected interpreter refer to the environment where the package is installed. If they differ, select the environment containing the package or install the dependency into the selected environment.

After verifying that the terminal’s python is the intended executable, install a missing package with:

python -m pip install <package>

Using python -m pip runs pip through that specific Python executable, helping avoid installing into a different environment by mistake. If the package is genuinely in a non-standard location, configure python.analysis.extraPaths for that location rather than changing search paths without cause. Microsoft documents these import-resolution options in its Python editing guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Inspect the debugger only if debug runs differ

The debugger uses the selected interpreter by default, but a python property in the active launch.json configuration can override it. If IntelliSense and the terminal agree but a debug run launches another Python, inspect that configuration and the executable path used by the current debug setup. See Microsoft’s Python debugging documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Match the symptom to the context

Symptom Likely context mismatch What to check
Pylance marks an installed package as missing The package is installed in another environment, or it is outside standard import locations. Select the environment containing the package; use python.analysis.extraPaths only for a genuine non-standard package location. Microsoft’s editing guide.
A new terminal uses system Python Automatic activation is off, overridden, or not behaving as expected. Review python-envs.terminal.autoActivationType and recreate the terminal. Microsoft’s settings reference.
An existing terminal remains on the old environment The shell has not been recreated or manually reactivated. Open a fresh terminal and verify its executable. Microsoft’s environments guide.
Only debug runs use another Python The active launch.json configuration may specify another interpreter. Inspect the configuration’s python property. Microsoft’s debugging guide.
The intended environment is absent from the picker Its location may be outside configured discovery paths, or the environment may be broken. Check environment search paths or repair the environment. Microsoft’s environments guide.

Keep the three checks distinct

  • Selected interpreter: the environment VS Code associates with the workspace and Python language features.
  • Terminal executable: the Python that the current shell resolves when you run python.
  • Debugger interpreter: the selected environment by default, unless the active debug configuration overrides it.

Finding which of these differs tells you where to fix the configuration instead of repeatedly changing the interpreter selection when the problem is actually a stale terminal, import path, or debugger override. For an overview of interpreter selection and Python workflows in VS Code, see Microsoft’s Python in Visual Studio Code page.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.