Repository navigation
nb_venv_kernels - Use venv/uv environments as Jupyter kernels #18156
stellarshenson
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'd like to share an extension I built to solve a common workflow friction - making Python virtual environments appear in JupyterLab's kernel selector without manual
ipykernelinstall commands.The Problem
Standard Jupyter cannot see kernels inside virtual environments. The typical workflow requires:
source .venv/bin/activate python -m ipykernel install --user --name=myprojectThis becomes tedious when managing multiple projects, and the installed kernelspecs can become stale when environments are deleted or moved.
The Solution
nb_venv_kernels discovers and registers kernels from venv, uv, and conda environments automatically.
Key Features:
How It Works
Unlike
nb_conda_kernelswhich uses a runner script,nb_venv_kernelsexecutes kernels directly using the venv's Python with environment variables:Installation:
Environments need ipykernel installed to be discoverable.
Repository: https://github.com/stellarshenson/nb_venv_kernels
I welcome feedback on the implementation approach, particularly around the kernel execution mechanism and conda integration strategy.
All reactions