millejoh / emacs-ipython-notebook

Jupyter notebook client in Emacs
http://millejoh.github.io/emacs-ipython-notebook/
GNU General Public License v3.0
1.47k stars 123 forks source link

Worksheet ready, but not opening #749

Closed dsche-cyber closed 3 years ago

dsche-cyber commented 3 years ago

Problem description

Issue same as #480 Open a .ipynb in doom emacs. C-c C-o. Choose parent dir of opened .ipynb.

There are three different cases that appear: 1.) Notebook .ipynb pending open" Retry? (y or n) after y nothing happens (ksysguard shows a new process jupyter-notebook) 2.) Notebook does not open in any buffer, instead minibuffer prints Worksheet is ready. 3.) For some notebooks it works (the notebook opens in a new buffer)

Steps to reproduce the problem

After ein:notebook-open, click on Open for some notebooks.

Info asked for in #480

After M-x ein:log-pop-to-all-buffer

In M-x ein:log-pop-to-request-buffer I get:

[debug] request--callback: executing success
[debug] request--callback: executing complete
[debug] /tmp/curl-trace unreadable

The debug report:

System info:

("EIN system info"
 :emacs-version
 "GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cairo version 1.17.3)
 of 2020-08-28"
 :emacs-bzr-version nil
 :window-system x
 :emacs-variant nil
 :os
 (:uname
  "Linux dsche-pc 5.8.11-1-MANJARO #1 SMP PREEMPT Wed Sep 23 14:35:40 UTC 2020 x86_64 GNU/Linux
"
  :lsb-release
  "LSB Version: n/a
Distributor ID: ManjaroLinux
Description:    Manjaro Linux
Release:    20.1.1
Codename:   Mikah
")
 :notebook
 "Name: notebook
Version: 6.1.4
Summary: A web-based notebook environment for interactive computing
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.com
License: BSD
Location: /usr/lib/python3.8/site-packages
Requires: jinja2, tornado, pyzmq, argon2-cffi, ipython-genutils, traitlets, jupyter-core, jupyter-client, nbformat, nbconvert, ipykernel, Send2Trash, terminado, prometheus-client
Required-by: widgetsnbextension, jupyterlab, jupyterlab-server
"
 :ipython "7.18.1
"
 :image-types
 (svg png gif tiff jpeg xpm xbm pbm)
 :image-types-available
 (svg png gif tiff jpeg xpm xbm pbm)
 :request
 (:backend curl)
 :ein
 (:version nil
           :source-dir "/home/dsche/.emacs.d/.local/straight/build/ein/")
 :lib
 ((:name "websocket"
         :path "~/.emacs.d/.local/straight/build/websocket/websocket.elc"
         :featurep t
         :version-var websocket-version
         :version "1.12")
  (:name "anaphora"
         :path "~/.emacs.d/.local/straight/build/anaphora/anaphora.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "request"
         :path "~/.emacs.d/.local/straight/build/request/request.elc"
         :featurep t
         :version-var request-version
         :version "0.3.0")
  (:name "deferred"
         :path "~/.emacs.d/.local/straight/build/deferred/deferred.elc"
         :featurep t
         :version-var deferred:version
         :version "0.5.0")
  (:name "polymode"
         :path "~/.emacs.d/.local/straight/build/polymode/polymode.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "exec-path-from-shell"
         :path
         "~/.emacs.d/.local/straight/build/exec-path-from-shell/exec-path-from-shell.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "dash"
         :path "~/.emacs.d/.local/straight/build/dash/dash.elc"
         :featurep t
         :version-var nil
         :version nil)
  (:name "with-editor"
         :path "~/.emacs.d/.local/straight/build/with-editor/with-editor.elc"
         :featurep t
         :version-var nil
         :version nil)))
dickmao commented 3 years ago

Uploading the problematic .ipynb here, if that's possible, would help me reproduce the problem.

dsche-cyber commented 3 years ago

In this folder (from a github textbook) I tried to open calibrating-qubits-pulse.ipynb: Folder

dickmao commented 3 years ago

Thanks for reporting the bug. fe63100b should help.

dsche-cyber commented 3 years ago

The first time I tried to open it, it worked, but now it does not. Maybe it is important to know, that this is an online book, so this has probably some html parts and also it has latex formulas in it. So together there are a lot of formats that need to be parsed correctly...

In M-x ein:log-pop-to-request-bufferI get:

[debug] request--callback: executing success
[debug] request--callback: executing complete
[debug] /tmp/curl-trace unreadable
[debug] request--curl-callback: event finished

[debug] request--callback: UNPARSED

[debug] request--callback: PARSED

[debug] request--callback: executing success
[debug] request--callback: executing complete
[debug] /tmp/curl-trace unreadable
dickmao commented 3 years ago

Edit: gc-cons-threshold, not gc-operation

grep -- gc-cons-threshold /home/dsche/.emacs.d/.local/straight/build/ein/* should return nothing.

Here I open the notebook, run ein:stop, then reopen the notebook. doom

dsche-cyber commented 3 years ago

Indeed you command returns nothing. For you the notebook opens automatically, for me not. Finally I got it: I needed to manually open it (C-x b, and choose the buffer, I think this is not intended behaviour, also the old buffer still persist with the plain text, for you its automatically closing).

Moreover I get a Warning after C-c C-o. Also Latex text is not displaying.

ein_not_working

dickmao commented 3 years ago

If it weren't already obvious, I think your EIN experience under your current doom configuration may not be worth it.

EIN cannot handle any undo-mode other than the default. It deftly sidesteps undo-tree-mode but I did not foresee undo-fu-mode, and noticed it's not easily sidestepped without messing with a user's global preferences. EIN can only warn "Disabling undo for undo-fu-only-undo" and consequently undo won't work at all.

There is also an outstanding memory leak for single-line ipynb files in #740 .

As for the central issue of "Notebook pending open! Retry?", I suspect an error is getting swallowed. You'd need to M-: (setq debug-on-error t) to get emacs to stop and backtrace when it happens.

Latex rendering is a known deficiency https://github.com/millejoh/emacs-ipython-notebook/projects/3