Skip to content

Instantly share code, notes, and snippets.

@DanielKotik
Last active October 3, 2024 14:08
Show Gist options
  • Save DanielKotik/df92b725f013d46fe9344b23fde9b88a to your computer and use it in GitHub Desktop.
Save DanielKotik/df92b725f013d46fe9344b23fde9b88a to your computer and use it in GitHub Desktop.
Jupyter kernel for pipenv

See stackoverflow and https://ipython.readthedocs.io/en/stable/install/kernel_install.html

In your project folder:

pipenv install ipykernel
pipenv shell

This will bring up a terminal in your virtualenv like this:

(my-virtualenv-name) bash-4.4$

In that shell do:

python -m ipykernel install --user --name=my-virtualenv-name

Launch jupyter notebook:

jupyter notebook

In your notebook, Kernel -> Change Kernel. Your kernel should now be an option.

Uninstall unwanted kernels:

  • get the paths of all your kernels jupyter kernelspec list
  • remove kernel jupyter kernelspec uninstall unwanted-kernel
@hanaahammad
Copy link

thanks a lot :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment