allen-ball / ganymede

The Ganymede Kernel is a Jupyter Notebook Java kernel based on the Java Shell tool, JShell.
Apache License 2.0
58 stars 3 forks source link

Should the ganymede kernel be installed into /usr/local/share/jupyter/kernels/? #7

Open dclong opened 1 year ago

dclong commented 1 year ago

It's installed into /usr/share/jupyter/kernels/ by default on Linux. It seems to me that most other Jupyter/Lab kernels are installed to /usr/local/share/jupyter/kernels/.

allen-ball commented 1 year ago

Can you tell me some more about you set-up? Is /usr/local/share your sys-prefix?

The Ganymede kernel install supports the --sys-prefix and --user (default) options and on macOS / Home Brew the respective install targets are:

$ $(/usr/libexec/java_home -v 11)/bin/java -jar ganymede-2.1.1.20221231.jar -i --sys-prefix
[InstallKernelSpec] Installed kernelspec ganymede-2.1.1-java-11 in /usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/share/jupyter/kernels/ganymede-2.1.1-java-11
$ $(/usr/libexec/java_home -v 11)/bin/java -jar ganymede-2.1.1.20221231.jar -i --user
[InstallKernelSpec] Installed kernelspec ganymede-2.1.1-java-11 in /Users/ball/Library/Jupyter/kernels/ganymede-2.1.1-java-11
dclong commented 1 year ago

How do I check my sys-prefix? I'm using JupyterLab, and the command jupyter kernelspec list shows that all kernels are installed into /usr/local/share/ instead of /usr/share/.

allen-ball commented 1 year ago

The actual test to get the path the Ganymede installer is using is python -c 'import sys; print(sys.prefix)'. (I can see that this likely needs to be "python3" for Ubuntu...)

BTW, there are still some issues running with the jupyter lab but the jupyter notebook interface should work fine.

So, a few more questions:

Thanks again.

allen-ball commented 1 year ago

FYI, I am going to change the algorithm to find the python executable: Instead of searching for it on the $PATH I am going to examine the first line of the jupyter executable.

dclong commented 1 year ago

python -c 'import sys; print(sys.prefix)' returns /usr on my system. Below are more info about my environment. OS: Ubuntu LTS (in Docker) Python: 3.10.6 Install: pip install jupyterlab

patelabhilash commented 1 year ago

my installation location as ubuntu WSL user:

Available kernels:
  ganymede-2.1.1-java-17    /home/patel/.local/share/jupyter/kernels/ganymede-2.1.1-java-17
  python3                   /usr/share/jupyter/kernels/python3

Hope it helps! working fine for me.