I have a Bash script that takes in two arguments. In the script it activates a conda environment using:
eval "$(/opt/miniforge3/bin/conda shell.bash hook)"
conda activate <env>
Once the script is done it deactivates the conda environment using:
conda deactivate
This script works and the conda environment is activated, data is downloaded, and the environment is deactivated.
However, if I call the script from another Bash script passing the two arguments then conda fails to find my conda environment and gives the error:
# conda environments:
#
base * /opt/miniforge3
EnvironmentNameNotFound: Could not find conda environment: <env>
You can list all discoverable environments with `conda info --envs`.
How do I correctly call a bash script from another bash script and get the second script to activate the conda environment?