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

Specification of kernel directory on command line? #53

Closed
mikecroucher opened this issue Apr 25, 2015 · 6 comments · Fixed by jupyter/jupyter_client#8
Closed

Specification of kernel directory on command line? #53

mikecroucher opened this issue Apr 25, 2015 · 6 comments · Fixed by jupyter/jupyter_client#8

Comments

@mikecroucher
Copy link

Kernel specification files can currently be one of two locations - System wide or user specific.

Would it be possible to add the ability to specify a kernel directory on the command line? Something like

ipython notebook --kernel_dir=/Users/me/my_kernels/

This could take precedence over the other 2 locations.

One example where this would be useful:
I'm currently trying to build a portable Jupyter install on windows that includes an R kernel. It's for teaching use on a heavily locked-down managed desktop.

The install is based on the PortablePython project and works reasonably well. I have 2 problems, however:

  • I have to install kernels to the user-profile which defeats the portability somewhat.
  • If I move the directory containing the portable install, I have to regenerate my kernels.

The enhancement proposed here would fix everything since I could specify the kernel_dir as a relative path in a launch shortcut.

@takluyver
Copy link
Member

Is sys.prefix within the portable install directory? You should be able to put kernel specs in sys.prefix + '/share/jupyter/kernels/' and it will find them.

@mikecroucher
Copy link
Author

Yes, that works nicely. Thank you!
Furthermore, If I put the portable R folder within the directory specified by sys.prefix, this kernel appears to works fine:

{"argv": ["R/R-Portable/App/R-Portable/bin/i386/R.exe","-e","IRkernel::main()", "--args","{connection_file}"], "display_name":"Portable R" }

I'm going to test the portability by moving between machines but things are looking good!
Thank's for the swift and useful reply!

@takluyver
Copy link
Member

Great. I'll leave this open because I think specifying a relative path in argv works by happy coincidence rather than deliberate design, and we might want to formalise a way to do that.

@mikecroucher
Copy link
Author

Thanks. For info, here are the steps I took to get everything working using Portable Python and Portable R

http://www.walkingrandomly.com/?p=5734

@takluyver
Copy link
Member

Great, thanks for writing that up. It looks like portable builds of Python will be an official thing when Python 3.5 comes out, so we won't have to rely on a not-very-maintained third party build. I quite like the idea of making 'Jupyter on a stick' - a USB stick with Jupyter, IPython, R and whatever else makes sense.

takluyver added a commit to takluyver/jupyter_client that referenced this issue Apr 29, 2015
This makes it easier to make a portable Jupyter+kernels setup, because
you can specify executable paths for kernels relative to the parent
process' prefix, e.g. `argv: ['{prefix}/bin/R', ...]`

Closes jupyter/notebook#53
takluyver added a commit to takluyver/jupyter_client that referenced this issue Apr 29, 2015
This makes it easier to make a portable Jupyter+kernels setup, because
you can specify executable paths for kernels relative to the parent
process' prefix, e.g. `argv: ['{prefix}/bin/R', ...]`

Closes jupyter/notebook#53
@takluyver
Copy link
Member

jupyter/jupyter_client#8 would make it possible to specify an executable with a relative path from sys.prefix, like ['{prefix}/bin/R', ...].

@minrk minrk added this to the 4.0 milestone Dec 14, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants