Skip to content

A Jupyter kernel that delegates to ipykernel in the .venv environment of a project folder

License

Notifications You must be signed in to change notification settings

goerz/python-localvenv-kernel

Repository files navigation

Python Local .venv Kernel

Github Build Status PyPI Conda Version Conda Recipe MIT License

A Jupyter kernel that delegates to ipykernel in the .venv environment of a project folder.

Derived from poetry-kernel, see the FAQ.

See the demo at the December 2023 Jupyter Community Call:

Jupyter Community Call

Installation

The python-localvenv-kernel package can be installed via pip (pip install python-localvenv-kernel) or as a Conda package (conda install python-localvenv-kernel).

It must be installed into the same environment as the Jupyter server, see Usage below.

Usage

  • Jupyter and the python-localvenv-kernel package should be installed in the same environment
  • The project folder must have a virtual (project) environment instantiated in a subfolder .venv. The name of folder can be overridden by setting the environment variable KERNEL_VENV (see FAQ)
  • The project environment must include the ipykernel package (but not jupyter)
  • Start Jupyter from the project folder
  • Select the "Python (local .venv)" kernel

Jupyter launcher screenshot (kernel selector)

Jupyter launcher screenshot (notebook)

FAQ

See FAQ.md.

About

A Jupyter kernel that delegates to ipykernel in the .venv environment of a project folder

Topics

Resources

License

Stars

Watchers

Forks