jupyter-xeus / xeus-sql

Jupyter kernel for SQL databases
https://xeus-sql.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
163 stars 22 forks source link

How do I set up a Jupyter kernelspec for Xeus-SQL? #86

Open gwerbin opened 6 months ago

gwerbin commented 6 months ago

I want to try the Xeus-SQL kernel in my project's Mamba environment, but also use a centrally-installed Jupyter instance such as Jupyter Desktop.

However, I don't see any instructions for setting this up using jupyter kernelspec install or any other mechanism.

Is this a supported mode of operation? If so, what are the correct steps? Or if I need to set up the Kernel JSON manually, what should I put in it?

erlefloch commented 3 weeks ago

It's not in the xeus-sql docs, but you can run from your environment jupyter-kernelspec list to see the paths to available kernel specifications, and then install the kernel you want with jupyter-kernelspec install --user <path to kernel spec> . For xeus-sql the kernel spec was at $MAMBA_ROOT_PREFIX/envs/< env name >/share/jupyter/kernels/xsql

gwerbin commented 1 week ago

Thanks, but I'm a little confused by this advice.

I do not need or want Jupyter in my project environment. When I run jupyter kernelspec list using my system-wide Jupyter installation, I only see kernel specs that I have already installed.

I did install Jupyter in a test environment and I see that there is a kernelspec installed in <root>/share/jupyter/kernels/xsql. Is that location expected to be stable? If so, I can just hard-code it into my setup script, and maybe it can be documented as the standard location. I'm happy to make that change myself if I can figure out the docs contribution process.

erlefloch commented 1 week ago

I do not need or want Jupyter in my project environment. When I run jupyter kernelspec list using my system-wide Jupyter installation, I only see kernel specs that I have already installed.

jupyter kernelspec is provided by the jupyter_client package, which is not the jupyterlab server. You would need to install it in your project's mamba environment prior to running the commands mentionned in my previous comment, sorry for the omission.