top | item 44047986

(no title)

chthonicdaemon | 9 months ago

If you have an environment set up with a pyproject.toml, just select the Jupyter kernel you installed in the environment. That feels like the case that is well handled by current tooling.

I believe this is solving the common complaint that you can't just email a jupyter notebook, since it doesn't capture the dependencies.

discuss

order

nsonha|9 months ago

let's say you have a project with a pyproject.toml and some notebooks. You'll have to 1. Come up with some name for the kernel, 2. Add a script to install the kernel, polluting the collaborator's jupyter installation 3. Add a README referring to 2.

chthonicdaemon|9 months ago

It sounds like you expect the collaborator to have one jupyter installation that you would pollute with the kernel. In my projects that use jupyter, I always have jupyterlab as one of the dependencies. Not sure about the naming part, since I usually just put my project in a directory named for the project, and uv uses that name for the venv, so I literally have never had to "come up with some name for the kernel".

In my case, I usually cd to the project directory, activate the associated environment, then do one of the following to work on a notebook in one of my projects, `jupyter lab`, `pycharm .`, or `code .` and go from there. In all of these cases, I get the ability to open notebooks that make use of this environment, either in the actual Jupyter lab interface, or in the tool's notebook interface (pycharm or vs code). All of these options make it pretty effortless to use the kernel associated with the environment - it's either automatically selected or it's the default in the dropdown.