Hello, I'm trying to execute a notebook from the command line and am getting the error "No kernel found that matches the current python executable," but I for sure have ipykernel in my environment. After some debugging I found the problem here. The problem is cmd = kernel_specs.argv[0] returns just python for conda (well, I'm using mamba) environments, at least with my setup. So then on line 39 it compares python to the executable path /home/me/mambaforge/envs/myenv/bin/python with os.path.samefile and skips it.
It looks like it'll take some playing around with the info in kernel_specs.argv to get a reliable absolute path to the executable which can be compared to sys.executable? The problem is, these don't appear to be very consistent:
Hello, I'm trying to execute a notebook from the command line and am getting the error "No kernel found that matches the current python executable," but I for sure have ipykernel in my environment. After some debugging I found the problem here. The problem is
cmd = kernel_specs.argv[0]
returns justpython
for conda (well, I'm using mamba) environments, at least with my setup. So then on line 39 it comparespython
to the executable path/home/me/mambaforge/envs/myenv/bin/python
withos.path.samefile
and skips it.It looks like it'll take some playing around with the info in
kernel_specs.argv
to get a reliable absolute path to the executable which can be compared tosys.executable
? The problem is, these don't appear to be very consistent:System details: