Open traversaro opened 9 months ago
Ok, I think I found a way, still not super ergonomic but it is working:
Micromamba: Activate environment by path
--> Pass the folder of the environment you want to open, if you just created it via mamba C:\Users\straversaro\AppData\Local\miniforge3\envs\<name>
or C:\Users\straversaro\AppData\Local\mambaforge\envs\<name>
on Windows, and /home/traversaro/miniforge3/envs/<name>
or /home/traversaro/mambaforge/envs/<name>
on LinuxThis comment https://github.com/prefix-dev/pixi/issues/411#issuecomment-1837234946 is related. They refer to https://github.com/direnv/direnv-vscode, and indeed a possible workaround/workflow is to define a direnv
's .envrc
file that activates the conda environment?
I did some quick tests, on Linux the direnv extension work really well, even if you just installed direnv and you did not hooked it to your shell, CMake extensions then find all the C++ dependencies in the conda/pixi environment.
Instead on Windows I was not able to make direnv to work, apparently there are still some issues on the Windows side:
Cool! We maybe want to update the suggested extensions to include this then.
Apparently I never found this (extremely related) issue: https://github.com/microsoft/vscode-cmake-tools/issues/1445 .
At the moment, everyone in the lab using Visual Studio Code with conda/mamba is actually launching
code
in a terminal in which the environment has been activated. This is cumbersome and complex, it would be great to find an alternative.Past research on the topic: