vscode-jupyter: Can't start IRkernel due to unnecessary quotes when launching the kernel via the CLI
Applies To
- Notebooks (.ipynb files)
- Interactive Window and/or Cell Scripts (.py files with #%% markers)
What happened?
I try to use R in Jupyter with IRkernel, and it works well on my Jupyter lab.
But when I tried to use VSCode to open R .ipynb files, I got this:
Seems that jupyter-vscode can’t start this customized kernel correctly. I tried to reinstall the extension or change to pre-release version, but all failed.
In my view, the problem seems to be a wrong format of string? I tried to fix it in the specFile, but can’t solve the problem.
VS Code Version
1.71.0
Jupyter Extension Version
v2022.8.1002431955 & 2022.9.1002511105
Jupyter logs
error 11:42:23.768: Error in execution (get message for cell) o [Error]: The kernel died. Error: Error in open.connection(con, "rb") : cannot open the connection
Calls: <Anonymous> ... parse_and_simplify -> parseJSON -> parse_con -> open -> open.connection
In addition: Warning message:
In open.connection(con, "rb") :
cannot open file 'r'"c:\Users\Ma Jiahao\AppData\Roaming\jupyter\runtime\kernel-v2-24568JN5dWQkG77fG.json"'': Invalid argument
Execution halted... View Jupyter [log](command:jupyter.viewOutput) for further details.
at ChildProcess.<anonymous> (c:\Users\Ma Jiahao\.vscode\extensions\ms-toolsai.jupyter-2022.9.1002511105\out\extension.node.js:2:2177745)
at ChildProcess.emit (node:events:538:35)
at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
category: 'kerneldied',
kernelConnectionMetadata: {
kind: 'startUsingLocalKernelSpec',
kernelSpec: {
specFile: '***\\kernel.json',
name: 'ir',
argv: [Array],
language: 'R',
executable: 'C:/PROGRA~1/R/R-42~1.1/bin/x64/R',
display_name: 'R',
metadata: [Object]
},
id: ".ir.c:\\PROGRA~1\\R\\R-42~1.1\\bin\\x64\\R.\\.c:/progra~1/r/r-42~1.1/bin/x64/r#--slave#-e#irkernel::main()#--args#r'{connection_file}'"
},
exitCode: 1,
stdErr: 'Error in open.connection(con, "rb") : cannot open the connection\r\n' +
'Calls: <Anonymous> ... parse_and_simplify -> parseJSON -> parse_con -> open -> open.connection\r\n' +
'In addition: Warning message:\r\n' +
'In open.connection(con, "rb") :\r\n' +
` cannot open file 'r'"c:\\Users\\Ma Jiahao\\AppData\\Roaming\\jupyter\\runtime\\kernel-v2-24568JN5dWQkG77fG.json"'': Invalid argument\r\n` +
### original: '"***\\kernel-v2-24568JN5dWQkG77fG.json"'': Invalid argument\r\n`'"
'Execution halted\r\n'
}
Coding Language and Runtime Version
R 4.2.1 with IRkernel 1.3
Language Extension Version (if applicable)
No response
Anaconda Version (if applicable)
No response
Running Jupyter locally or remotely?
Local
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (10 by maintainers)
It works now Thank you for taking the time and effort to solve this issue for us. I really appreciate your help.
🎉🎉🥳IT WORKS🥳🎉🎉
Thank you so much! Your help is very much appreciated.
ms-toolsai-jupyter-insiders.vsix.zip
@jlgraves-ubc @masharifi01 Please could you try the above VSIX
Install from VSIX
pointing to the extracted file aboveI’m sorry this has not yet been resolved, and thank you for your patience
Sorry, didn’t realized it was cutoff.
Show Logs
I’ve been experiencing an identical error, including the missing json file. Have there been any developments on this front?