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: Hongyi Zhao
Subject: Re: Pyenv and Jupyter integration with emacs.
Date: Sat, 13 Mar 2021 08:52:01 +0800

On Fri, Mar 12, 2021 at 9:04 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> On Thu, Mar 11, 2021 at 11:27 PM Skip Montanaro
> <skip.montanaro@gmail.com> wrote:
> >>
> >> 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 think that the emacs-ipython-notebook project is created a bit
> longer ago when the ipython is the prevailing name.
>
> > 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.
> >
>
> I've just simply given a try to emacs-ipython-notebook and opened a
> .ipynb file in Emacs.
>
> And searching google with "emacs ipython notebook tutorial" directs me
> to the following introduction represented by the author of the
> project:
>
> https://www.youtube.com/watch?v=OB9vFu9Za8w

Some new discoveries that I stumbled upon:

https://ddavis.io/posts/emacs-python-lsp/
https://realpython.com/emacs-the-best-python-editor/

Based on the experience/guidance shared on the above instructions, it
seems the following combination is a better setup for the problem
discussed here:

https://github.com/jorgenschaefer/elpy
https://github.com/jorgenschaefer/pyvenv
https://github.com/millejoh/emacs-ipython-notebook

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China



reply via email to

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