From 9af8d82a1e3cd6c7f3d922655aebd0f6608517e9 Mon Sep 17 00:00:00 2001 From: imohammad12 Date: Mon, 30 Aug 2021 20:51:00 -0400 Subject: [PATCH] Bug fixed when adding custom conda env in Jupyter I think each env should be deactivated after being added as a kernel in Jupyter. The previous version causes the following error for me when I have multiple custom Conda environments. Just the first custom Conda environment in the loop is added correctly. Note that all custom Conda environments will appear on Jupyter, but not all of them work correctly. The error in terminal: Could not find Conda environment: "name_of_the_custom_conda_env" --- scripts/persistent-conda-ebs/on-start.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/persistent-conda-ebs/on-start.sh b/scripts/persistent-conda-ebs/on-start.sh index 656fb10..6e6dd0f 100644 --- a/scripts/persistent-conda-ebs/on-start.sh +++ b/scripts/persistent-conda-ebs/on-start.sh @@ -22,6 +22,7 @@ for env in $WORKING_DIR/miniconda/envs/*; do BASENAME=$(basename "$env") source activate "$BASENAME" python -m ipykernel install --user --name "$BASENAME" --display-name "Custom ($BASENAME)" + conda deactivate done # Optionally, uncomment these lines to disable SageMaker-provided Conda functionality.