Kia ora! I’ve run into a pesky problem whereby, when running the following workflow:
#!Jinja2
{% set CYCLE_START_DATE = '20240801' %}
{% set CYCLE_END_DATE = '20240802' %}
[scheduling]
initial cycle point = {{CYCLE_START_DATE}}
final cycle point = {{CYCLE_END_DATE}}
[[graph]]
P1D = """
a
"""
[runtime]
[[a]]
platform = belenos
script = """
set -x
export MODULEPATH=/home/ext/mr/spsy/mercator/modulefiles:$MODULEPATH
module -s purge
module -s load gcc/9.2.0 intel/2018.5.274 intelmpi/2018.5.274 phdf5/1.8.18 netcdf_par/4.7.1_V2 xios-trunk_rev2134
conda deactivate
conda activate glo12_ease
env | grep -i PYTHON
mpiexec.hydra -n 128 -ppn '32(x4)' noobs_mpi -f /home/ext/mr/smer/turekg/cylc-run/glo12_cylc/run5/work/20201001T0000Z/obsopr/paraminput/FREE/ -cycle 20201003 -L 3 -OO 1 --typ SLA SST SIC VPT VPS -nxios 42
"""
I was getting a no module found error because it appeared to be looking for it in the cylc env rather than the glo12_ease one. We realized that in fact the cylc environment appears before the glo12_ease one.
Adding the deactivate before the activate solved the issue, but:
- Other scripts also use the glo12_ease env. but we have not experienced this issue
- My colleague does not have this issue. In her case the path order of the environments is correct. (She is using cylc-flow 3.8.3, me 3.8.4.We are both going to update to 3.8.5 just in case)
3)Both of us initialize conda in our ~/.bashrc
In general, what is the “best practice” when dealing with conda envs within workflows (given that cylc itself lives in its own conda environment)?