Dear all,
First of all happy new year and best wishes for 2022!
I would like to use environment modules to load/unload Conda environments (https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-envs <https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-envs>).
I have a working environment module for Conda alone. Now I need a module for a specific Conda environment. For this I use the code below to load/unload the environment:
## My conda environment module file
module load conda
if { [module-info mode load] || [module-info mode switch2] } {
puts stdout "conda activate $path"
} elseif { [module-info mode remove] && ![module-info mode switch3] } {
puts stdout "conda deactivate"
}
If I do module load my_conda_environment; module unload my_conda_environment, I get an error because the conda dependency is unloaded first and then the conda command is not found anymore.
However this works: module load conda; module load my_conda_environment; module unload my_conda_environemt; module unload conda.
Is there a way to have the result of the previous line, without having to explicitly load conda? Thank you for your help.
Best regards,
Marius
|