pythonvisual-studio-codeanaconda

Activating Anaconda Environment in VsCode


I have Anaconda working on my system and VsCode working, but how do I get VsCode to activate a specific environment when running my python script?


Solution

  • 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