guysv / ilua

Portable Lua kernel for Jupyter
GNU General Public License v2.0
119 stars 12 forks source link

Installing to Jupyter's kernelspec? #17

Closed jltml closed 3 years ago

jltml commented 3 years ago

Hi! Apologies in advance if this is a terrible question — I'm a little unsure how to install ILua to Jupyter such that it's listed when you run jupyter kernelspec list. IRuby, for example, has a command iruby register that you run to install the kernel to ~/Library/Jupyter/kernels/* (I'm on a Mac). IJavascript has ijsregister. Is there a similar sort of thing for ILua, or any way to accomplish the same?

I tried running jupyter kernelspec install ~/.local/pipx/venvs/ilua/share/jupyter/kernels/lua --user (I installed ILua with pipx, which is why the path is like that), but it failed and said there was 'no module ilua' or something along those lines.

I'm just curious because I use Hydrogen for Atom, which ties into jupyter notebook.

No worries at all if this isn't supported/can't be fixed/etc, just thought I'd ask — and many thanks for making this in the first place :)

Edit — I accidentally hit 'submit new issue' while I was in the middle of writing it; sorry about that!

guysv commented 3 years ago

Hey.

ILua does not have a 'register' command. Registering the language was supposed to happen during pip install. Sadly pip is very fragile, and tbh I didn't follow the latest python packaging guidelines, so I don't know if the code stayed compatible with what's right.

Anyway, in this repo, you got the ilua/defaultspec directory. Those are the files that get copied into jupyter directories during iruby register or whatever. I'd check out what's exactly is happening in the languages that seem to work (ruby), and do that manually for the lua files. hope that helps!

jltml commented 3 years ago

Ah, makes complete sense — I'm guessing it has to do with me installing with pipx instead of just pip. I'll take a look at the files and otherwise just try with pip. Thanks for the help (and for making this; it's really awesome to have available)!