help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pyenv and Jupyter integration with emacs.


From: Skip Montanaro
Subject: Re: Pyenv and Jupyter integration with emacs.
Date: Thu, 11 Mar 2021 09:28:05 -0600

>
> I still don't quite understand what you wrote above. OTOH, from my
> intuitive point of view, it seems that emacs-ipython-notebook is more
> powerful then emacs-jupyter.
>

I just picked one and tried it. I chose it in large part because "jupyter"
is a newer name than "ipython." I found the README file unhelpful and just
stumbled my way to connecting to an existing kernel. As for the file, when
you run "jupyter notebook" it creates a number of files in
~/.local/share/jupyter/runtime and prints a bit of output to the terminal,
for example:

   To access the notebook, open this file in a browser:

file:///home/skip/.local/share/jupyter/runtime/nbserver-533322-open.html
    Or copy and paste one of these URLs:

http://localhost:8888/?token=5de6661699de63f03da52dd1bdf6a4f18f8cb2119373d6e0
     or
http://127.0.0.1:8888/?token=5de6661699de63f03da52dd1bdf6a4f18f8cb2119373d6e0

None of those URLs is actually what jupyter-connect-repl requires. Here are
the files just created when I restarted my notebook server and the two
kernels just now:

% ls -ltr ~/.local/share/jupyter/runtime/
total 120
...
-rw-r--r-- 1 skip skip 287 Mar 11 09:19 nbserver-533322.json
-rw-r--r-- 1 skip skip 673 Mar 11 09:19 nbserver-533322-open.html
-rw------T 1 skip skip 263 Mar 11 09:21
kernel-9e8ca820-639b-44e8-9322-6570db2a9a21.json
-rw------T 1 skip skip 263 Mar 11 09:21
kernel-2b4f57f1-466c-44c6-9871-c9bcb007e3ca.json

The first two files are the ones the notebook command created. The second
two files are the result of restarting the two kernels. Those are the files
jupyter-connect-repl needs. As I indicated, this is not clear from the
README file. There is no good way to guess which of the kernel-*.json files
you want to use for the connect operation because the kernel_name field is
empty. If you are only running a single kernel that's okay I suppose. It
would be nice if there was an obvious way to name kernels when opening an
existing ipynb file or when (re)starting the associated kernel. It doesn't
appear there is, however.

Rereading your original note, I didn't see any indication that you'd tried
any of the three options or had a perceived preference. Had you expressed a
preference at that point, I would likely have given it a try.

Skip


reply via email to

[Prev in Thread] Current Thread [Next in Thread]