Activating Anaconda Environment in VsCode Activating Anaconda Environment in VsCode python python

Activating Anaconda Environment in VsCode


Simply use

  1. shift + cmd + P
  2. Search Select Interpreter

pyhton : Select Interpreter

  1. Select it and it will show you the list of your virtual environment created via conda and other python versions

Activating conda virtual environment

  1. select the environment and you are ready to go.

Quoting the 'Select and activate an environment' docs

Selecting an interpreter from the list adds an entry for python.pythonPath with
the path to the interpreter inside your Workspace Settings.


If Anaconda is your default Python install then it just works if you install the Microsoft Python extension.

The following should work regardless of Python editor or if you need to point to a specific install:

In settings.json edit python.path with something like

"python.pythonPath": "C:\\Anaconda3\\envs\\py34\\python.exe"

Instructions to edit settings.json


Setting python.pythonPath in VSCode's settings.json file doesn't work for me, but another method does. According to the Anaconda documentation at Microsoft Visual Studio Code (VS Code):

When you launch VS Code from Navigator, VS Code is configured to use the Python interpreter in the currently selected environment.

Anaconda Navigator