nteract / kernelspecs

:card_index: Find Jupyter kernelspecs on a system
BSD 3-Clause "New" or "Revised" License
9 stars 11 forks source link

Cannot locate kernels under `%APPDATA%/jupyter/kernels` #31

Closed n-riesco closed 6 years ago

n-riesco commented 6 years ago

Steps to reproduce:

  1. Create file %APPDATA%/jupyter/kernels/javascript/kernel.json:

    { "argv": [ "C:\Users\User\AppData\Roaming\ijskernel.cmd", "--hide-undefined", "{connection_file}", "--protocol=5.0" ], "display_name": "Javascript (Node.js)", "language": "javascript" }
  2. Open a node session and run:

    > var ks = require("kernelspecs")
    > ks.findAll().then(console.log)
    {}

Re:

n-riesco commented 6 years ago

After some debugging, it turned out to be an issue with parsing kernel.json in windows. Fixed by escaping the backward-slashes in kernel.json:

{ "argv": [ "C:\\Users\\User\\AppData\\Roaming\\ijskernel.cmd", "--hide-undefined", "{connection_file}", "--protocol=5.0" ], "display_name": "Javascript (Node.js)", "language": "javascript" }