guysv / ilua

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

No such kernel named lua #13

Closed zccafa3 closed 1 year ago

zccafa3 commented 3 years ago

I'm hoping someone can help me with this. Installed using pip3 install ilua successfully. Lua 5.2.4 has also been installed, following https://www.lua.org/download.html When running ilua from the console, I get the error message "No such kernel named lua"

I've exhaustively searched google for a resolution, without success. I'd be very appreciative of any assistance on this Issue. Please let me know if there is any additional information I can provide (and how to aquire it) to help better diagnose the problem.

~ % ilua
Traceback (most recent call last):
  File "/Users/zccafa3/Library/Python/3.7/bin/ilua", line 8, in <module>
    sys.exit(main())
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/ilua/consoleapp.py", line 37, in main
    ILuaConsoleApp().run()
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/ilua/consoleapp.py", line 34, in run
    ZMQTerminalIPythonApp.launch_instance(argv=['--kernel', 'lua'])
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/traitlets/config/application.py", line 663, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-117>", line 2, in initialize
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_console/app.py", line 142, in initialize
    self.init_shell()
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_console/app.py", line 109, in init_shell
    JupyterConsoleApp.initialize(self)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/consoleapp.py", line 341, in initialize
    self.init_kernel_manager()
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/consoleapp.py", line 293, in init_kernel_manager
    self.kernel_manager.start_kernel(**kwargs)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/manager.py", line 304, in start_kernel
    kernel_cmd, kw = self.pre_start_kernel(**kw)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/manager.py", line 257, in pre_start_kernel
    kernel_cmd = self.format_kernel_cmd(extra_arguments=extra_arguments)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/manager.py", line 181, in format_kernel_cmd
    cmd = self.kernel_spec.argv + extra_arguments
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/manager.py", line 87, in kernel_spec
    self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)
  File "/Users/zccafa3/Library/Python/3.7/lib/python/site-packages/jupyter_client/kernelspec.py", line 235, in get_kernel_spec
    raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named lua
guysv commented 3 years ago

first of all: macos support is work in proress (i.e. yet to exist).

just fresh-installed it on my mac, unlike your it launched, but crashed after the first command.

Regarding how I know jupyter, i'd say this bug happened because jupyter couldn't discover ilua's configuration files properly. I have two requests to you:

  1. ls -laR /usr/local/share/jupyter/
  2. check if ipython, jupyter's primary shell, is working.
zccafa3 commented 3 years ago

Thank you very much for your reply and input. I used to have ilua installed on my old mac, and it would launch and run just fine.

  1. At first this did not work using the default directory. Seemed to work after providing the installed path. a) ~ % ls -laR /usr/local/share/jupyter ls: /usr/local/share/jupyter: No such file or directory b) '~ % ls -laR /Users/zccafa3/Library/Python/3.7/share/jupyter total 16 drwxr-xr-x 4 zccafa3 staff 128 23 Aug 09:53 . drwxr-xr-x 5 zccafa3 staff 160 23 Aug 12:25 .. -rw-r--r--@ 1 zccafa3 staff 6148 23 Aug 09:53 .DS_Store drwxr-xr-x 5 zccafa3 staff 160 23 Aug 11:29 kernels

/Users/zccafa3/Library/Python/3.7/share/jupyter/kernels: total 16 drwxr-xr-x 5 zccafa3 staff 160 23 Aug 11:29 . drwxr-xr-x 4 zccafa3 staff 128 23 Aug 09:53 .. -rw-r--r--@ 1 zccafa3 staff 6148 23 Aug 17:08 .DS_Store drwxr-xr-x 6 zccafa3 staff 192 23 Aug 17:41 lua drwxr-xr-x 5 zccafa3 staff 160 23 Aug 17:41 python3

/Users/zccafa3/Library/Python/3.7/share/jupyter/kernels/lua: total 40 drwxr-xr-x 6 zccafa3 staff 192 23 Aug 17:41 . drwxr-xr-x 5 zccafa3 staff 160 23 Aug 11:29 .. -rw-r--r--@ 1 zccafa3 staff 157 23 Aug 17:41 kernel.json -rw-r--r-- 1 zccafa3 staff 1856 23 Aug 11:29 logo-32x32.png -rw-r--r-- 1 zccafa3 staff 4355 23 Aug 11:29 logo-64x64.png -rw-r--r-- 1 zccafa3 staff 594 23 Aug 11:29 logo-license.txt

/Users/zccafa3/Library/Python/3.7/share/jupyter/kernels/python3: total 24 drwxr-xr-x 5 zccafa3 staff 160 23 Aug 17:41 . drwxr-xr-x 5 zccafa3 staff 160 23 Aug 11:29 .. -rw-r--r-- 1 zccafa3 staff 143 23 Aug 17:41 kernel.json -rw-r--r-- 1 zccafa3 staff 1084 23 Aug 09:26 logo-32x32.png -rw-r--r-- 1 zccafa3 staff 2180 23 Aug 09:26 logo-64x64.png`

I use multiple versions of pycharm. Typically I use homebrew to manage package installations, not pip, as it better handles this and related pathing issues (in my experience). As brew install ilua was not available, I used pip3 install ilua to install the package. This required me to overcome some pathing issues with a .zshrc file; export PATH="${PATH}:/Users/zccafa3/Library/Python/3.7/bin" export PYTHONPATH="${PYTHONPATH}:/Users/zccafa3/Library/Python/3.7/bin" However, Lua 5.2.4 has been installed to the default location. I suspect it has something to do with this.

  1. This runs fine. `~ % ipython
    Python 3.7.3 (default, Apr 24 2020, 18:51:23) Type 'copyright', 'credits' or 'license' for more information IPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: `

chengsun commented 2 years ago

Jupyter looks in a different data path by default on Mac OS. See: https://docs.jupyter.org/en/latest/use/jupyter-directories.html#id2

If your kernel lives at $path/kernels/lua/kernel.json, then you can set the environment variable JUPYTER_DATA_DIR=$path to get ilua working.

zccafa3 commented 1 year ago

A long way down the road (sorry life got in the way for a while) and a fresh install later, I am able to use ilua again. Unfortunately, some other (unrelated) issues started to crop up with my mac, which lead to a whipe and fresh install, so I was not (and cannot currently) reproduce this issue. Closing this out (but of course re-open if you would like the record for yourselves). Thanks