Skip to content

Instantly share code, notes, and snippets.

@raeidsaqur
Created April 30, 2020 20:29
Show Gist options
  • Save raeidsaqur/97a1ca434ca9f5c53f2c19298c81b953 to your computer and use it in GitHub Desktop.
Save raeidsaqur/97a1ca434ca9f5c53f2c19298c81b953 to your computer and use it in GitHub Desktop.
Handling Conda Environments in Jupyter Notebook
#!/bin/bash
# Create virtual env in Conda
conda create -n aenv python=3.8
conda activate aenv
# To [list|remove]
#conda env [list|remove] [-n aenv]
# Add Conda env to Jupyter Notebook
pip install --user ipykernel
# Add desired env to Jupyter kernel:
python -m ipykernel install --user --name=aenv
# Output -> Installed kernelspec myenv in /home/${whoami}/.local/share/jupyter/kernels/aenv
# List|Remove expired/unwanted env from Jupyer kernel:
jupyter kernelspec list # list all
jupyter kernelspec uninstall aenv # remove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment