Skip to main content

ipykernel-uv

A Jupyter kernel that uses uv to automatically manage Python environments for your projects. When you select this kernel, it finds the nearest pyproject.toml, syncs the project's dependencies with uv, and launches IPython inside that environment — no manual virtual environment management required.

How it works

  1. You select the Python (uv) kernel in JupyterLab
  2. The kernel finds the nearest pyproject.toml by walking up from the notebook's directory
  3. If it can't find one, it creates ones in the notebook's directory
  4. If ipykernel is not already in the project's dependencies, it adds it via uv add
  5. It runs uv run --project <dir> python -m ipykernel_launcher
  6. uv syncs the project's environment and starts IPython inside it

This means your notebook automatically has access to all the dependencies declared in your project's pyproject.toml. The ipykernel package is added to your project's dependencies automatically if not already present.

Requirements

  • Python >= 3.10
  • uv installed and available on PATH

Installation

Install the package:

pip install ipykernel-uv

Or with uv:

uv pip install ipykernel-uv

Then register the kernel spec. Choose one of the following options:

# Install for the current user
python -m ipykernel_uv install --user

# Install into the current virtual environment
python -m ipykernel_uv install --sys-prefix

# Install into a specific prefix
python -m ipykernel_uv install --prefix /path/to/prefix

Usage

  1. Setup: pyproject.toml
    • Make sure your project/directory has a pyproject.toml with its dependencies listed.
    • Or, if it can't find a nearby pyproject.toml one will be created.
  2. Open JupyterLab and create or open a notebook in your project directory
  3. Select the Python (uv) kernel from the kernel picker
  4. Your notebook now runs inside your project's uv-managed environment
  5. You can add new package using !uv add <project> inside a notebook cell.

Install options

Flag Description
--name Kernel name (default: python3-uv)
--display-name Display name in Jupyter (default: Python (uv))
--user Install for the current user
--sys-prefix Install into sys.prefix (e.g. the active virtual environment)
--prefix Install into a specific prefix directory

Development

# Clone the repo
git clone https://github.com/jupyter-ai-contrib/ipykernel-uv.git
cd ipykernel-uv

# Sync the development environment
uv sync

# Install the kernel spec locally
uv run python -m ipykernel_uv install --sys-prefix

License

BSD-3-Clause

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipykernel_uv-0.0.2.tar.gz (91.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipykernel_uv-0.0.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ipykernel_uv-0.0.2.tar.gz.

File metadata

  • Download URL: ipykernel_uv-0.0.2.tar.gz
  • Upload date:
  • Size: 91.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for ipykernel_uv-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4c2b8670621ff43d56fffe793b4a146e6367c90b0fb3245a293e7cb123c71c0c
MD5 2b775fa6a21b875d587c52183de1f74c
BLAKE2b-256 cd9fd5eda4105ce445d5d8dd423b039bd2f1fc716c0ac5ebfb4fa1aa54dd3aac

See more details on using hashes here.

File details

Details for the file ipykernel_uv-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: ipykernel_uv-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for ipykernel_uv-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 19fdbce80af8747eadafd3bc09036fe5f8752638c80c36dfa812cde1e1fb5061
MD5 5b8f7a96c5a4b7207dbedb35cf2b4026
BLAKE2b-256 b81769374d6332de8a0385e3526cad985f64206df8127d15a07942e29211dd6d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page