0

i have a local customized emacs with the emacs ein package. I am able initiate a jupyter kernel locally (via emacs or via the terminal) and start an interactive jupyter notebook session.

However, I would like to run the jupyter kernel on a remote machine, to which I can tunnel via ssh. It seems that this thread (https://github.com/millejoh/emacs-ipython-notebook/issues/249) provides a solution to this issue, but I cannot decipher all that's described there. It starts with the instruction '*you need to set *ein:console-executable', which apparently is done by executing (setq ein:console-executable (expand-file-name "~/envs/ein/bin/ipython")). But where do I execute this piece of lisp code? Furthermore, it seems that ein:console is some sort of a subpackage to ein? I don't think I have it installed, but it also doesn't show in my melpa list.

This blog http://millejoh.github.io/emacs-ipython-notebook/#id31 tells me to use

(require 'ein)
(require 'ein-notebook)
(require 'ein-subpackages)

as a minimal configuration of ein. But when I paste this in my .emacs I get the warning: 'File is missing: Cannot open load file, No such file or directory, ein-subpackages' upon an emacs restart.

I appologize, that the description of my issue is not more precise, but that's the best I can do. Any help is very welcome.

1 Answer 1

0

the key to answer is port-forwarding. My limited understanding of this concept is the following: you want to initialize a jupyter kernel on a remote server and this kernel is than assigned a port, say 8888. This port may be forwarded to a port on your local machine. You can decide which port that will be, say 11111. This forwarding allows the information from the server to be transfered to you machine.

In practice:

  1. open a terminal and login to the remote server: ssh user@remote
  2. start a jupyter kernel without browser window on that server: jupyter notebook --no-browser (commonly you need to load a python module on the server first, e.g. module load python3 or sth. like this)
  3. open a second terminal and activate the port forwarding ssh -L 11111:localhost:8888 remote -N
  4. now you can execute ein:notebooklist-login which will then prompt URL or port. Type here the local port that you have chosen, i.e. 11111 in this example. Then emacs logs into that jupyter kernel and you can interactively edit the jupyter notebooks.

If you are not inside the same network as the remote server, you might need to establish a VPN connection first. May sure you use the right vpn protocol which actually grants you permissions to log into the jupyter kernel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.