Newsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.
Running jupyterlab via uv tool install#
I tried to get jupyterlab working via uv tool install today and ran into some sharp edges.
You can start like this:
1uv tool install jupyterlabThat ran for a while and output:
1Installed 4 executables: jlpm, jupyter-lab, jupyter-labextension, jupyter-labhubIt also gave me a warning about my PATH. I fixed that with:
1uv tool ensure-pathOn one other machine this didn’t work because it refused to over-write a previous installation. The fix was to run uv tool install with --force:
1uv tool install jupyterlab --forceNow we can start jupyterlab with:
1jupyter-labGetting %pip to work#
This was the biggest sticking point for me. Jupyter has a useful magic command for installing packages:
1%pip install llmWhen I tried to run this I got this error:
/Users/simon/.local/share/uv/tools/jupyterlab/bin/python: No module named pip
It turns out we have an installation with no pip binary.
There may be a better way to do this, but I found that this worked, run in a Jupyter notebook cell:
1import subprocess, sys2subprocess.check_call([sys.executable, "-m", "ensurepip"])After I ran this, the %pip magic command worked as expected - I didn’t even need to restart the kernel.
Reported to Jupyter#
I opened an issue about this and submitted a PR with a potential fix.