Skip to content

Instantly share code, notes, and snippets.

@agalea91
Last active August 9, 2023 19:46
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agalea91/44503a969aaacc2eb6ac3c40f7a62923 to your computer and use it in GitHub Desktop.
Save agalea91/44503a969aaacc2eb6ac3c40f7a62923 to your computer and use it in GitHub Desktop.
Create virtual environment for Jupyter Notebook
# Creating a virtual env kernel
# -----------------------------
$ python -m venv .venv
$ source .venv/bin/activate
(.venv) $ pip install ipykernel
(.venv) $ python -m ipykernel install --user --name=proj-name
# Managing the kernel
# -----------------------------
$ jupyter kernelspec list
$ jupyter kernelspec uninstall proj-name
# Kernel will be available for any Notebook instance,
# without needing to activate venv.
# Source: https://janakiev.com/blog/jupyter-virtual-envs/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment