nteract / kernelspecs

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

Kernelspecs doesn't find python kernel from sys-dir #18

Closed lgeiger closed 8 years ago

lgeiger commented 8 years ago

kernelspecs differs from jupyter kernelspec list --json on my system.

The output of jupyter kernelspec list --json is:

"kernelspecs": {
  "root": {
    "resource_dir": "/Users/lukasgeiger/Library/Jupyter/kernels/root",
    "spec": {
      "language": "c++",
      "display_name": "ROOT Prompt",
      "env": {},
      "argv": [
        "python",
        "-m",
        "IPython.kernel",
        "-f",
        "{connection_file}",
        "-c",
        "import ROOT;ROOT.toCpp();"
      ]
    }
  },
  "python2": {
    "resource_dir": "/usr/local/lib/python2.7/site-packages/ipykernel/resources",
    "spec": {
      "language": "python",
      "display_name": "Python 2",
      "env": {},
      "argv": [
        "/usr/local/opt/python/bin/python2.7",
        "-m",
        "ipykernel",
        "-f",
        "{connection_file}"
      ]
    }
  }
}

Though kernelspecs doesn't recognize the python kernel on my system:

{ root:
   { name: 'root',
     files:
      [ '/Users/lukasgeiger/Library/Jupyter/kernels/root/.DS_Store',
        '/Users/lukasgeiger/Library/Jupyter/kernels/root/kernel.json' ],
     resources_dir: '/Users/lukasgeiger/Library/Jupyter/kernels/root',
     spec: { language: 'c++', argv: [Object], display_name: 'ROOT Prompt' } } }
lgeiger commented 8 years ago

Today I tried it again and everything works as expected. I have no idea what I changed :)

lgeiger commented 8 years ago

I had to use the ipython kernel install command. Now the output matches.

rgbkrk commented 8 years ago

From a UX standpoint, what could we do to either help discover more or require on install for jupyter?

lgeiger commented 8 years ago

Jupyter gets the kernelspec directly from ipython if no python kernel is found (https://github.com/jupyter/jupyter_client/blob/master/jupyter_client/kernelspec.py#L135), but I don't know if this can be done in the node module as well.

rgbkrk commented 7 years ago

After a release of jupyter-paths and adaptation code to use opts.askJupyter, kernelspecs could pick it up:

https://github.com/nteract/jupyter-paths/blob/master/index.js#L176

rgbkrk commented 7 years ago

I'd rather that choice be on the node-based frontend using these libraries though, as I don't want to expect everyone to have jupyter installed to use nteract.