For me it worked by changing the final step in the selection process:

The start is as usual:

  • Command Palette
  • > Python: Select Interpreter
  • + Enter interpreter path

but then, not picking the option

  • Find... Browse your file system to find a Python interpreter (which opens a file explorer to select the interpreter)

but instead

  • directly enter the full path in the text field and press Enter.

In theory, both should have the same effect, but for my case they did not. (I had tried reloading the window, restarting vscode, adding the venv to the known venv folders in the workspace settings, even recreating the venv in case something went wrong there, but none of these options worked.)

Answer from user12378033 on Stack Overflow
🌐
Reddit
reddit.com › r/vscode › cannot change python interpreter
r/vscode on Reddit: Cannot Change Python Interpreter
September 7, 2022 - Thanks for the advice, after following these steps my terminal looks like yours, with "conda activate ..." but this doesn't seem to change the interpreter being used when I click the play button. ... How do you run the code? Is the Code Runner extension installed? If this extension is installed, this provides a Run Code option, with which running code may not use the interpreter you selected for vscode. Everything works fine if using the Run Python File option provided by the Python extension.
Discussions

python3 - Cant change python interpreter in Visual Studio Code on Mac - Unix & Linux Stack Exchange
In my console (iterm2) which python gives /Users/anders/anaconda3/bin/python In Visual Studio Code's built in terminal which python gives /usr/bin/python Since I want to use anacondas python instal... More on unix.stackexchange.com
🌐 unix.stackexchange.com
December 4, 2018
Python interpreter settings ignored if VS Code is launched from an activated environment
What python environment I have set in the terminal I launch it · I am not certain if other things also affect it, for a while I thought it was the history of what I did last time I had vscode open (as persistent terminals also caused me issues, but this I cannot reproduce). I have had continued issues with getting environments to persist in workspaces since the interpreter settings were changed ... More on github.com
🌐 github.com
10
July 18, 2024
Can't set Python interpreter
Issue Type: Bug I am following the steps for installing the Python plugin. I have installed the latest Python interpreter, but when I try to select it via the "Select Python Interpreter" ... More on github.com
🌐 github.com
14
June 19, 2020
visual studio code - Select Python interpreter does not work in VSCode - Python programs still use the old interpreter - Stack Overflow
Then set the python interpreter in VSCode to venv/bin/python3.9 and everything will work. This was reported but a fix didn't garner enough votes to be implemented. https://github.com/microsoft/vscode-python/issues/13603 · Of course, change the paths and python versions in the code above as needed. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Microsoft Learn
learn.microsoft.com › en-us › answers › questions › 5594952 › issue-with-the-interpreter-in-visual-studio-code
Issue with the interpreter in Visual Studio Code - Microsoft Q&A
October 23, 2025 - ... If nothing shows up, try clicking "Enter interpreter path" and manually browse to your Python installation (usually in C:\Users<YourName>\AppData\Local\Programs\Python\Python3.14).
🌐
Visual Studio Code
code.visualstudio.com › docs › python › environments
Python environments in VS Code
November 3, 2021 - Click the environment to change it. When you assign an environment to a project, the extension writes to your workspace settings (.vscode/settings.json): { "python-envs.pythonProjects": [ { "path": "backend", "envManager": "ms-python.python:venv" }, { "path": "ml-service", "envManager": "ms-python.python:conda" } ] } Notice that settings store the environment manager, not hardcoded interpreter paths.
Top answer
1 of 2
2

Maybe Virtual Studio Code does not use the same shell that you're using with iTerm2? According to the docs on the integrated terminal, the shell that is being used is the one which is set by the $SHELL environment variable. Inspect it with:

echo $SHELL

Furthermore, which scans your $PATH for an executable and return the first one found. So compare your settings there, too:

echo $PATH

If that is the issue, you can change $PATH, so it will find the python in /Users/anders/anaconda3/bin instead of /usr/bin.

Finally, it might help you to set an alias for python in the Visual Studio Code integrated terminal. You can set that up with:

$ alias python
bash: alias: python: not found
$ alias python=/Users/anders/anaconda3/bin/python
$ alias python
alias python='/Users/anders/anaconda3/bin/python'

(which might still show the other path, but if you run python, you'll get the one from the alias.)

2 of 2
0

I found a way to reset VS Code such that it works again.

Step one: Reset your $PATH variable -> this is temporary because all sorts of funky stuff starts to happen if you reset this:

$cd #go to home directory

$nano .bash_profile

# while in nano:

\export PATH="[path to anaconda python3]"

# save and exit

# reset .bash_profile

$. .bash_profile

now we need to set PATH to what it was, but nanowill no longer work, so we put following into the terminal:

$usr/bin/nano ~/.bash_profile

delete the line "\export PATH="[path to anaconda python3]""

# reset .bash_profile again

$. .bash_profile

Now if you open up VS Code (or a new terminal in VS Code), it should work!

🌐
GitHub
github.com › microsoft › vscode-python › issues › 23833
Python interpreter settings ignored if VS Code is launched from an activated environment · Issue #23833 · microsoft/vscode-python
July 18, 2024 - As I always launch vscode from the terminal, it seems to try to use the interpreter from the environment I launched it from, rather than the interpreter I have set. I understand that this may be a feature not a bug, some people may want the virtual environment from the launching terminal to override workspace settings. The ideal solution would be a global settings in settings.json to never try to guess my python interpreter from virtual environments.
Author   julianstirling
🌐
GitHub
github.com › microsoft › vscode-python › issues › 12463
Can't set Python interpreter · Issue #12463 · microsoft/vscode-python
June 19, 2020 - Issue Type: Bug I am following the steps for installing the Python plugin. I have installed the latest Python interpreter, but when I try to select it via the "Select Python Interpreter" button, VS code refuses to acknowledge it, instead...
Author   citizen12
Find elsewhere
🌐
YouTube
youtube.com › watch
How To Change Python Interpreter In VSCode (If It's Not Working) - YouTube
Join our Python dev community to meet other Python devs and ask questions!https://ghosttogether.com/PythonIn this tutorial, we will guide you through the ste...
Published   July 21, 2023
🌐
Python Forum
python-forum.io › thread-13618.html
VSCode can't select interpreter
May 14, 2021 - I've been fighting this for a week (or more) now, without success. I am running a virtual environment, and the terminal shows proper python, etc. however when I try to run by choosing 'Run python file in terminal' The virtual environment interpreter ...
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › python
Python in Visual Studio Code
November 3, 2021 - To change the current interpreter, which includes switching to conda or virtual environments, select the interpreter name on the Status Bar or use the Python: Select Interpreter command.
🌐
Posit
docs.posit.co › ide › server-pro › user › vs-code › guide › python-environments.html
Python Environments in VS Code – Posit Workbench Documentation Release 2026.04.0
VS Code will automatically detect ... appear in the bottom right corner. To change the selected interpreter open the Command Palette using Cmd + Shift + P on Mac or Ctrl + Shift + P on Windows....
Top answer
1 of 12
18

I just reloaded the Python extension which you will see when you go to VSCode and the "Python extension"; the "reload required" button will be there; just click and then check the "Python interpreter" in the "view" again; it will resolve the current issue which you are facing.

2 of 12
14

The reason for this, at least on Macs, is that the python/python3/python3.9 inside virtual environments is a symlink to the system interpreter in e.g. /opt/homebrew/bin/python3 and VSCode follows the symlink.

So the path for relative imports and all the packages in your virtual environment is now /opt/homebrew/bin instead of ./venv/bin, and so VSCode can't resolve any of the imports from your venv unless they happen to also be installed in /opt/homebrew/bin. This means you lose the "jump to definition" and similar functionality, "run this code" doesn't work, linters can't provide any kind of import-related feedback, etc.

A solution that works is to copy the python binary into the venv, rather than use symlinks. You can do this after you create the venv.

python -m venv venv
rm venv/bin/python venv/bin/python3 venv/bin/python3.9
cp /opt/homebrew/bin/python3.9 venv/bin/
ln -s venv/bin/python3.9 venv/bin/python
ln -s venv/bin/python3.9 venv/bin/python3
source venv/bin/activate
pip install -r your_requirements_file.txt

Then set the python interpreter in VSCode to venv/bin/python3.9 and everything will work.

This was reported but a fix didn't garner enough votes to be implemented.

https://github.com/microsoft/vscode-python/issues/13603

Of course, change the paths and python versions in the code above as needed.

🌐
TMS Outsource
tms-outsource.com › home › how to change python interpreter in vscode
How to Change Python Interpreter in VSCode - TMS Outsource
November 12, 2025 - Solution: The language server caches package information. Reload the VSCode window (Ctrl+Shift+P > “Developer: Reload Window”) after changing interpreters to force Pylance to reindex.
🌐
Donjayamanne
donjayamanne.github.io › pythonVSCodeDocs › docs › python-path
Python Path and Version | Python in Visual Studio Code
By default the extension uses the Python interpreter available in the current path. You could always change this by specifying the path to the interpreter in the user or worksapce settings.
🌐
Robot Framework
forum.robotframework.org › tools
Need to select Python interpreter in VS code - Tools - Robot Framework
March 18, 2025 - I have a warning message ‘Select Interpreter’ for python in VS code what I need to do and how? (all the python files run successfully)
🌐
Bobby Hadz
bobbyhadz.com › blog › change-python-version-select-correct-interpreter-in-vscode
VS Code: Change Python version & select correct Interpreter | bobbyhadz
If you aren't able to set the Python version and interpreter using the previous two approaches or your preferred Python interpreter doesn't show up in the menu, you have to specify the complete path to the interpreter.
🌐
Visual Studio Code
code.visualstudio.com › docs › python › settings-reference
Python settings reference
November 3, 2021 - The Python Extension for Visual Studio Code is highly configurable.
🌐
GitHub
github.com › microsoft › vscode-jupyter › issues › 5364
VS Code does not change to selected interpreter · Issue #5364 · microsoft/vscode-jupyter
March 30, 2021 - This env was created with conda, and it's python 3.7.10. Additionally, I have a custom library installed in there mlutils. As you can see from the image, if I run from the terminal, It shows the correct environment and correct executable. Furthermore, I can correctly import mlutils. However, on the notebook, I cannot make it change to another interpreter and it's using the base environment.
Author   CooperData