visual-studio-codevscode-devcontainermamba

Use micromamba virtual environment in VS Code


We have to use micromamba for our app because conda is prohibitively slow for installing our packages. We use a devcontainer to install micromamba and its packages. This works for the VS Code terminal but the editor still cannot find my packages.

I only see a way to activate the micromamba environment with a shell script snippet or shell rc file. The works for the terminal, but I dont see a way to activate it for the editor processes. The closest setting I found is specific to venvs.


Solution

  • The solution was to add a .env file setting PYTHONPATH to the modules. Then setting "python.envFile" in .vscode/settings.json to point to that .env file.