Skip to content

Commit

Permalink
Fix 'conda command not found' in AzureML example Creation scripts (#3321
Browse files Browse the repository at this point in the history
)

* Update setup-custom-conda-env.sh

* Update install-pip-package.sh

* Update setup-custom-conda-env.sh

The creation of the conda environment needs to be ran outside of the azureuser block
  • Loading branch information
lucasfijen authored Sep 11, 2024
1 parent b01a262 commit 7ae3bd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions setup/setup-ci/install-pip-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ sudo -u azureuser -i <<'EOF'
PACKAGE=numpy
ENVIRONMENT=azureml_py38
source /anaconda/etc/profile.d/conda.sh
conda activate "$ENVIRONMENT"
pip install "$PACKAGE"
conda deactivate
Expand Down
4 changes: 3 additions & 1 deletion setup/setup-ci/setup-custom-conda-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ set -e

# This script creates a custom conda environment and kernel based on a sample yml file.

source /anaconda/etc/profile.d/conda.sh
conda env create -f env.yml
echo "Activating new conda environment"
conda activate envname
conda install -y ipykernel
echo "Installing kernel"
sudo -u azureuser -i <<'EOF'
echo "Installing kernel"
source /anaconda/etc/profile.d/conda.sh
conda activate envname
python -m ipykernel install --user --name envname --display-name "mykernel"
echo "Conda environment setup successfully."
Expand Down

0 comments on commit 7ae3bd0

Please sign in to comment.