Last active
March 1, 2020 21:25
-
-
Save MohamedKari/7a90b191fe10caca7cb2bc6773181b25 to your computer and use it in GitHub Desktop.
Install Custom Env on SageMaker Notebook Instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
source deactivate | |
export CONDA_CUSTOM_ENV_URL="$1" | |
export CONDA_CUSTOM_ENV_PARENT_DIR="/home/ec2-user/SageMaker" | |
export CONDA_CUSTOM_ENV_DIR="$CONDA_CUSTOM_ENV_PARENT_DIR/custom_env" | |
cd $CONDA_CUSTOM_ENV_PARENT_DIR | |
curl $CONDA_CUSTOM_ENV_URL -o custom_env.yml | |
conda env create --prefix ./custom_env --file custom_env.yml | |
source activate $CONDA_CUSTOM_ENV_DIR | |
pip install ipykernel | |
python -m ipykernel install --user --name custom_env --display-name "Python (custom_env)" | |
# installs kernelspec at /home/ec2-user/.local/share/jupyter/kernels/custom_env | |
source deactivate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment