Skip to content

Instantly share code, notes, and snippets.

@kentwait
Last active January 11, 2024 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kentwait/80ccdf0b485129a158db1faf69f65c3f to your computer and use it in GitHub Desktop.
Save kentwait/80ccdf0b485129a158db1faf69f65c3f to your computer and use it in GitHub Desktop.
Add Conda environment to Jupyterlab
# FIRST, Activate env to add to Jupyter, e.g. venv
# conda activate venv
# Then run this script
# Edit ENV_NAME variable to name the kernel
# Kernel names can only contain ASCII letters and numbers and these separators: - . _ (hyphen, period, and underscore).
# This will be the label in JupyterLab
ENV_NAME=Conda
# Install ipykernel via conda/mamba
conda install ipykernel
# Add current active environment
ipython kernel install --user --name=${ENV_NAME}
# Deactivate env
conda deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment