Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install kernel without requiring users to install jupyter #20744

Open
DonJayamanne opened this issue Sep 30, 2023 · 8 comments · May be fixed by #23595
Open

Install kernel without requiring users to install jupyter #20744

DonJayamanne opened this issue Sep 30, 2023 · 8 comments · May be fixed by #23595
Labels

Comments

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Sep 30, 2023

Thanks for the great Jupiter kernel
Is it possible to perhaps consider creating an installer that doesn’t depend on the Jupyter cli

Installing the kernel is basically just a matter of creating a folder in a predefined location with some files (in the past I created a vscode extension that did just this for the typescript kernel)

perhaps this can be part of the vscode extension? A vscode command to install the kernel (by creating the files instead of using the Jupiter cli)

this would benefit users of vscode and tools wanting to use this kernel

Else a node/deno developer now needs to install python to try deno in notebooks

@bartlomieju
Copy link
Member

Hey @DonJayamanne we can certainly do that - out of curiosity does the VSCode extension not depend on actual jupyter Python package?

Do you happen to have a list of suggested locations we should try installing kernel to?

@DonJayamanne
Copy link
Contributor Author

VSCode extension not depend on actual jupyter Python package?

that’s right, vscode does not
We start kernels by spawning the process manually and communicating over zmq
The kernelspec.json contains the cli and that’s what’s used

So connecting to deno can be done without Jupyter/python in vscode

python is only required for Python kernels

@bartlomieju
Copy link
Member

Got it, very interesting. @rgbkrk any thoughts on this? This seems like a good idea, but I'm not sure where we should install the kernelspec in such case. Should we just accept --path flag (or default to last arg) deno jupyter --install <path_to_put_kernel_spec_to>

@rgbkrk
Copy link
Contributor

rgbkrk commented Oct 1, 2023

Having it built in is great, I think I'm just traumatized by all the varied options we allow in Jupyter for where to install kernelspecs. I think we can just install to the user directory and expand what we provide over time if needed.

@rgbkrk
Copy link
Contributor

rgbkrk commented Oct 1, 2023

These are the locations to provide per platform: https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs

zph added a commit to zph/deno that referenced this issue Apr 28, 2024
…pec installs

Closes: denoland#20744

Adds ability to specify the kernelspec location for deno kernel with
--directory flag

Continued default behavior installs in user's kernelspec folder via
jupyter shelling out:
`deno jupyter --install`

Advanced installs can specify their own path:
`deno jupyter --install --directory ~/.kernelspec_custom_location/deno`

In the advanced case deno builds and installs the files directly rather
than relying on calling out to jupyter to determine path.

This is useful in the circumstance where jupyter is not on PATH at time
of installing deno jupyter, but it is available and used via a wrapping
library.
zph added a commit to zph/deno that referenced this issue Apr 28, 2024
…pec installs

Closes: denoland#20744

Adds ability to specify the kernelspec location for deno kernel with
--directory flag

Continued default behavior installs in user's kernelspec folder via
jupyter shelling out:
`deno jupyter --install`

Advanced installs can specify their own path:
`deno jupyter --install --directory ~/.kernelspec_custom_location/deno`

In the advanced case deno builds and installs the files directly rather
than relying on calling out to jupyter to determine path.

This is useful in the circumstance where jupyter is not on PATH at time
of installing deno jupyter, but it is available and used via a wrapping
library.
@zph
Copy link

zph commented Apr 28, 2024

I also run into wanting control over installing deno's jupyter kernel without relying on jupyter being on the path in a circumstance where jupyter is installed wrapped in another program. In that case jupyter is not on the PATH.

A way to allow this behavior without requiring the hard coupling of deno<>jupyter paths as @rgbkrk called out, is that we allow users to specify their own paths. It would be an advanced feature via an optional cli flag --directory.

I'll put up a PR for this capability.

@DonJayamanne
Copy link
Contributor Author

called out, is that we allow users to specify their own path

I think the suggestion was that the CLI would automatically determine the location instead of having the user to provide this path

@rgbkrk
Copy link
Contributor

rgbkrk commented Apr 29, 2024

I've been working on a Rust library for interfacing with Jupyter kernels, called runtimelib. With it, we can drop the need for a globally available jupyter: https://github.com/runtimed/runtimed/blob/main/runtimelib/src/jupyter/dirs.rs

@bartlomieju I'd love to chat more about this

zph added a commit to zph/deno that referenced this issue May 1, 2024
…pec installs

Closes: denoland#20744

Adds ability to specify the kernelspec location for deno kernel with
--directory flag

Continued default behavior installs in user's kernelspec folder via
jupyter shelling out:
`deno jupyter --install`

Advanced installs can specify their own path:
`deno jupyter --install --directory ~/.kernelspec_custom_location/deno`

In the advanced case deno builds and installs the files directly rather
than relying on calling out to jupyter to determine path.

This is useful in the circumstance where jupyter is not on PATH at time
of installing deno jupyter, but it is available and used via a wrapping
library.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants