Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to use pipenv with Jupyter notebook?

Is there a way to use pipenv with Jupyter notebook?

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

like image 812
emehex Avatar asked Nov 14 '17 21:11

emehex


People also ask

Should I use pip or Pipenv?

While pip can install Python packages, Pipenv is recommended as it's a higher-level tool that simplifies dependency management for common use cases. This does a user installation to prevent breaking any system-wide packages.

Which Python does Pipenv use?

pipenv install --python 3.8.

Is Pipenv included in Python?

Pipenv is a packaging tool for Python that solves some common problems associated with the typical workflow using pip , virtualenv , and the good old requirements. txt . In addition to addressing some common issues, it consolidates and simplifies the development process to a single command line tool.

How do I run a Python project in Pipenv?

To activate the environment, just navigate to your project directory and use pipenv shell to launch a new shell session or use pipenv run <command> to run a command directly.


1 Answers

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

like image 149
Luis Meraz Avatar answered Sep 22 '22 08:09

Luis Meraz