[Lmod-users] Difference between bash and cshell for source_sh
A Lua based environment module system that reads TCL modulefiles.
Brought to you by:
rtmclay
|
From: Jakob S. <jak...@fa...> - 2026-03-16 16:55:38
|
Dear Lmod users,
at our site we provide the users with a conda installation via lmod.
While this works fine, we also have some locally compiled code that
depends on python and we use conda environments for it. We managed to
activate and deactivate a specific conda env via a module file doing
nothing else other than having a `execute{cmd='conda activate {env}',
modeA={'load'}}` and correspondingly for unload.
This works as expected in the shell (provided the conda module is loaded
and not requiested via, e.g., `depends_on`, i.e., set as `prereq`).
However, when the module for the conda environment is used in another
module file it does work as expected using bash, but it fails for cshell.
The problem is not because of lmod, but because how conda initializes
for bash or cshell. In the latter case the `conda activate` throws an
error `CondaError: Run 'conda init' before 'conda activate`. I suspect
that the way how lmod modifies the environment interferes with how conda
wants it to be when running.
So, in short:
cshell> module load conda
cshell> module load conda_env
works, while
cshell> module load conda conda_env
does not.
For bash, both work just fine.
I was wondering if someone tried to solve a similar issue and came up
with a good solution.
Thanks!
Jakob
|