Skip to content
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

Error: JavaScript Jupyter kernel not found #102

Open
laggingreflex opened this issue Dec 24, 2021 · 2 comments
Open

Error: JavaScript Jupyter kernel not found #102

laggingreflex opened this issue Dec 24, 2021 · 2 comments

Comments

@laggingreflex
Copy link

Getting this error:

magicpatch-install
Error: JavaScript Jupyter kernel not found. Try installing or re-installing IJavascript?
at C:\Users...\AppData\Roaming\npm\node_modules\magicpatch\bin\magicPatchInstall.js:30:15
at processTicksAndRejections (node:internal/process/task_queues:96:5)

I believe I have IJavascript installed and working. I can run JS code in my notebook in VSCode by selecting Javascript Kernel.

I'm on Windows and have followed the Anaconda method https://github.com/n-riesco/ijavascript#windows-anaconda-distribution to install IJavascript.

I'm running magicpatch-install in an elevated Anaconda shell.

In the file magicPatchInstall.js:30 I logged jupyterConfig, kernels and got

{
  Jupyter: {
    packages: [
      { package: 'parsing error', version: 'parsing error' },
      [Object: null prototype] {
        package: 'IPython',
        version: '7.29.0'
      },
      [Object: null prototype] {
        package: 'ipykernel',
        version: '6.4.1'
      },
      ....
    ]
  }
}
kernels: [
  { kernel: 'parsing error', path: 'parsing error' },
  { kernel: 'parsing error', path: 'parsing error' }
]

Does this make it seem that I don't have IJavascript installed properly? But then how am I able to use it in VSCode..? And what could I do?

@laggingreflex
Copy link
Author

laggingreflex commented Dec 24, 2021

Found the problem. This change in lib\magics\report\jupyter.js:54 makes it work:

// let match = line.match(/^\s+(?<kernel>\w+)\s+(?<path>\/.*)$/);
let match = line.match(/^\s+(?<kernel>\w+)\s+(?<path>[\w\/].*)/);

(apart from adding \w, removing $ was also required for reasons beyond me.)

The regex used was based on:

// 'jupyter kernelspec list' should look like:

// Available kernels:
//   javascript      /Users/ampower/Library/Jupyter/kernels/javascript
//   javascriptex    /Users/ampower/Library/Jupyter/kernels/javascriptex
//   python3         /opt/local/Library/Frameworks/Python.framework/Versions/3.7/share/jupyter/kernels/python3

However on my Windows it looks like

jupyter kernelspec list
Available kernels:
  javascript    C:\Users\me\AppData\Roaming\jupyter\kernels\javascript
  python3       C:\tools\Anaconda3\share\jupyter\kernels\python3

Please feel free to use this as a patch. I'm not confident in my Regex so I'd double check if it still works in *nix.

@apowers313
Copy link
Owner

Super helpful, thank you. I’ll try to incorporate the fix in the next release. Might be a few weeks as I’m working on a Deno kernel right now. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants