-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernelspecs with non-default arguments don't work. #7063
Comments
Also I noticed that the file path ( Is there any particular reason why vscode-jupyter sends individual arguments instead of using a valid existing connection file ? |
This is a result of our kernel daemon we use to speedup kernel launching (we have a process already running that we pass the arguments to, and it starts ipykernel for us). It's not handling this case and should probably be skipped in this scenario. The line throwing the exception is here:
|
@saisasidhar If i get a VSIX ready, are you able to test this out at your end? |
Thanks for the update @DonJayamanne |
@saisasidhar I'm sorry for the delay in getting back to you, attached is the VSIX, please use VS Code insiders to install & test this VSIX |
@DonJayamanne Thank you very much for providing a VSIX file for testing. Unfortunately, I get the same "Unsupported KernelSpec file" error. Here are the last two stack traces for brevity:
VS Code Insiders Version: 1.62.0-insider (user setup)
|
Let me have a look, i think the insider version of the jupyter extension wasn't release to the marketplace. |
I'm sorry for some reason the extesnion was't published, and should be in the marketplace now. Please update the Jupyter extesnion installed to the latest (currently latest is Appreciate your patience in this matter and do let me know if this fixes it. |
Thank you @DonJayamanne for releasing the insider version to marketplace. The extension is now working as expected, and it is able to start interactive kernel based on my kernel spec. Just a minor thing I noticed while testing. This insider version does not display names of kernels (defined in the kernel spec file), i.e all kernels in my virtual environment instead have the same name, |
Please could you file a bug and ping me on that issue. |
Hi, still facing this same issue. |
Environment data
Expected behaviour
According to jupyter documentation kernel.json must contain certain keys and values.
I expect that my custom kernel.json (language=python) can also be launched in Interactive Window mode of this extension with the following argv.
Note that
{connection_file}
argument exists as described in kernel spec.Actual behaviour
Extension fails with the following notification:
The extension expects that a python kernel should always be started using
python -m module_name
which as far as I understand does not adhere to the generic nature of kernelspec definitions.-f
argument as well as--ip
,--iopub
etc--something
and--something-else
arguments first and then starts an ipython kernel by callingIPython.embed_kernel(cfg)
.--something*
does some network and logging customization I need, and that is the reason why I want to start up the kernel as a scriptcfg
is an instance oftraitlets.config.loader.Config
that contains ip, ports, transport, key etc that the script received from{connection_file}
or from command line arguments directly.I know the
embed_kernel()
works with this extension because when I symbolically link this main.py file to a python file invenv/lib/python3.7/site-packages/main_link.py
directory and usepython -m main_link
in kernel.json, the extension and interactive window works just as expected.However, I think it would be a correct implementation if vscode-jupyter extension handles argv as it was defined in a kernel.json instead of assuming all python kernels would be started with
python -m module_name
.Steps to reproduce
Assuming jupyter package is installed in a virtual environment.
custom_kernel
at./venv/share/jupyter/kernels
./venv/share/jupyter/kernels/python3
to./venv/share/jupyter/kernels/custom_kernel
(copies kernel.json and icon*.png)./venv/share/jupyter/kernels/custom_kernel/kernel.json
to have the following{ "argv": [ "python", "/path/to/main.py", "--something", "--something-else", "--f", "{connection_file}" ], "display_name": "custom-kernel", "language": "python", "metadata": { "debugger": true } }
custom-kernel
Logs
mainThreadExtensionService.ts:63
mainThreadExtensionService.ts:64
The text was updated successfully, but these errors were encountered: