nteract / jupyter-paths

:city_sunrise: Pure JavaScript implementation of jupyter --paths --json
BSD 3-Clause "New" or "Revised" License
9 stars 11 forks source link

`dataDirs` method doesn't get all jupyter kernel paths #27

Open JonnyCBB opened 6 years ago

JonnyCBB commented 6 years ago

Problem The dataDirs method doesn't pick up all of the kernel directories on my machine. In particular, I installed the Ruby kernel on my machine and although it's picked up by Jupyter, it's not picked up using dataDirs from this package.

Example This is what I get using dataDirs:

> var jp = require('jupyter-paths')
undefined
> jp.dataDirs({ withSysPrefix: true }).then(console.log)
Promise {
  <pending>,
  domain:
   Domain {
     domain: null,
     _events: { error: [Function: debugDomainError] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [] } }
> [ '/Users/jonnybrooks-bartlett/Library/Jupyter',
  '/Users/jonnybrooks-bartlett/anaconda3/envs/rlm/share/jupyter',
  '/usr/local/share/jupyter',
  '/usr/share/jupyter' ]

However, using jupyter kernelspec list I get

jupyter kernelspec list

Available kernels:
  ruby         /Users/jonnybrooks-bartlett/.ipython/kernels/ruby
  julia-0.6    /Users/jonnybrooks-bartlett/Library/Jupyter/kernels/julia-0.6
  julia-0.7    /Users/jonnybrooks-bartlett/Library/Jupyter/kernels/julia-0.7
  python3      /Users/jonnybrooks-bartlett/Library/Jupyter/kernels/python3
  python-3     /usr/local/share/jupyter/kernels/python-3

Notice that the dataDirsmethod doesn't pick up the ruby kernel in /Users/jonnybrooks-bartlett/.ipython/

rgbkrk commented 6 years ago

Ohhhhh I see because we're not checking the old .ipython directory. That could be handled here.

rgbkrk commented 6 years ago

Thanks for outlining your kernel directory structure, this is super helpful!

rgbkrk commented 6 years ago

Issue in IRuby about using the legacy directory: https://github.com/SciRuby/iruby/issues/110

JonnyCBB commented 6 years ago

Thanks for addressing this. I've managed to get around the issue by manually moving the Ruby kernel directories to the Jupyter path for now. Let's hope they update it in their repo. I guess we can close this issue when the relevant PR gets merged?