Is there a way to use pipenv with Jupyter notebook?

emehex picture emehex · Nov 14, 2017 · Viewed 28.6k times · Source

Is there a way to use pipenv with Jupyter notebook?

Or more specifically, with an atom nteract/hydrogen python 3 kernel?

Answer

Luis Meraz picture Luis Meraz · Nov 15, 2017

Just tried the following with success.

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.

Change Kernel Screenshot

Source: IPythonNotebookVirtualenvs