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

manual kernel switching #39

Closed
willwhitney opened this issue May 26, 2015 · 11 comments
Closed

manual kernel switching #39

willwhitney opened this issue May 26, 2015 · 11 comments

Comments

@willwhitney
Copy link
Collaborator

While defining mappings between grammar names and kernel languages is good for cleaning up nonstandard language names, there are situations where you want to change the kernel being used manually:

  1. Running some one-off code
  2. Selecting which of several kernels for a particular language to use (e.g. python2 vs. python3)

To support these use cases, we should add some way of switching kernels.

I think it makes the most sense to replace the existing grammar -> kernel mapping config with this. The interaction might be something like this:

  1. Open Command Palette
  2. "Hydrogen: Select kernel for grammar " (Python Django)
  3. Choose from all of the kernels, listed by their display_name (Python 3.4)
  4. This mapping persists until it is changed again. Close Atom and reopen it to a Python Django file and it should load the Python 3.4 kernel.

Does this sound like a reasonable interaction?

@willwhitney willwhitney modified the milestone: v0.5.0 May 26, 2015
@TKCen
Copy link
Contributor

TKCen commented May 26, 2015

I'd say #40 is somewhat related, too. It would bind kernels to files though.

@Ardelean-Calin
Copy link

So is there a way right now to switch the ipython kernel from "ipython" to "ipython3"? Because it tries to run the ipython kernel ( which is ipython2), instead of the ipython3 kernel.

@TKCen
Copy link
Contributor

TKCen commented May 29, 2015

I guess the solution would be to have ipython3 only on your Path, as the current kernel mapping seems to not support a mapping like:

{"Python": "python3"}

but maybe I'm missing something there. @willwhitney should know more.

@Ardelean-Calin
Copy link

Well, creating a symbolic link like this

ln -s /usr/bin/ipython3 /usr/bin/ipython

also works.

@willwhitney
Copy link
Collaborator Author

There are actually a few issues here.

  1. IPython doesn't currently build kernelspec files for itself, meaning that Hydrogen can't know what ipythons are installed on your machine.
  2. ipython kernel doesn't accept a connection file in the same way that other kernels do
  3. Hydrogen needs UI for switching
  4. and 2. mean that Hydrogen launches Python kernels differently than others; it always calls ipython. At present, I think using symlinks to make ipython call the IPython you want to run is the best option, as ugly as it is. If ipython currently points to a Python 2 ipython install, you can of course rename that to ipython2.

@rgbkrk is there a better way for Hydrogen to support this given the current state of the IPython kernel?

@rgbkrk
Copy link
Member

rgbkrk commented May 29, 2015

On current master, the IPython kernel is installed as a standalone kernel with a kernel.json. This will be better on the coming 4.0 release, which is much better focused on supporting alternative kernels.

However, there is a way to install the kernels when on a 3.x release:

python2 -m IPython kernelspec install-self # Viva la Python 2
python3 -m IPython kernelspec install-self # Viva la Python 3

I'm on an ✈️, but I'll come back to this thread later. I certainly agree with needing a UI for switching

@stevengj stevengj mentioned this issue Oct 8, 2015
@stevengj
Copy link

stevengj commented Oct 8, 2015

As I mentioned in #119, this is also common for Julia developers who have multiple Julia versions installed for testing purposes. These are all installed as separate kernelspecs (julia-0.3, julia-0.4, and julia-0.5 in my case) in my Jupyter directory. What I would like would be:

  • A way to change the kernel manually at runtime in Atom.
  • A way to set a preference for the default kernel to use with a given language. (e.g. if I want all Python files to default to the Python 3 kernel, or all Julia files to default to the Julia 0.4 kernel)

@maximsch2
Copy link
Contributor

Is it possible to also add an option of selecting a remote kernel? If I have an IPython notebook running on the remote server, it would be nice to be able to execute code in the context of the one of the notebooks there.

@willwhitney
Copy link
Collaborator Author

This has been discussed quite a bit. It's definitely on my "want" list, but
it's not clear that there's currently a good way to do this. I do expect to
implement this eventually, but don't hold your breath.

On Fri, Oct 9, 2015 at 6:22 PM Maxim Grechkin notifications@github.com
wrote:

Is it possible to also add an option of selecting a remote kernel? If I
have an IPython notebook running on the remote server, it would be nice to
be able to execute code in the context of the one of the notebooks there.


Reply to this email directly or view it on GitHub
#39 (comment)
.

@el-uhu
Copy link

el-uhu commented Oct 21, 2015

Relating to this issue:
Hydrogen stopped working for me when, I upgraded to julia 0.4.0 (on Ubuntu 15.10 via ppa).
After rebuilding IJulia, normal jupyter notebooks worked fine. However Hydrogen would not connect properly to the kernel. This led to a situation where hydrogen would look like it had executed code, but in fact it only showed the ✔️ sign and produced no output.

I realised that the upgrade of Julia had deprecated the previous julia 0.3 kernel. This still showed up in jupyter kernelspec list but was no longer functional. Just deleting the deprecated kernel and reloading atom did not help, however re-installing hydrogen finally fixed it.

Whereas I realise that it bad practise anyway to keep deprecated kernels, I think exposing kernel-connection settings would definitely help.

@willwhitney willwhitney removed this from the next release milestone Dec 14, 2015
@lgeiger lgeiger closed this as completed Jul 10, 2016
@lgeiger
Copy link
Member

lgeiger commented Jul 10, 2016

See #138

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

8 participants