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

little problem with (json-readtable-error 207) #862

Closed Neptenu closed 1 year ago

Neptenu commented 1 year ago

Problem description

it needs two steps (M-x ein:run M-x ein:login) to start ein with Emacs, both on win10 LTSC 21H2 and win7 the [warn] about jupyter-default-kernel also appears when i install ein from elpa

Steps to reproduce the problem

First I used M-x ein:run or M-x ein:jupyter-server-start , it hanppens nothing but *Message* show:

Loading f:/Emacs/code_problem.el (source)...done
[yas] Prepared just-in-time loading of snippets successfully.
For information about GNU Emacs and the GNU system, type C-h C-a.
ein: [warn] ein:jupyter-default-kernel: (json-readtable-error 207)
ein: [info] ein:jupyter-server--run: d:/Python_env/help/Scripts/jupyter.exe notebook --notebook-dir=r:/jk --no-browser
ein: [warn] Jupyter server failed to start, cancelling operation

Then I used M-x ein:login RET RET it come out successfully:

Contents API 5 (http://127.0.0.1:8888)

 | [Home] |

[New Notebook] [Resync] [Open In Browser]

Create New Notebooks Using Kernel:
(*) Python 3 (ipykernel)

[Open] [----] [Delete] : Untitled.ipynb                                    2023-03-02

My ein with EMACS behave different with others, so maybe some wrong with it. but I cant figure it out.

System info:

("EIN system info"
 :emacs-version "GNU Emacs 28.1 (build 2, x86_64-w64-mingw32)
 of 2022-04-22"
 :window-system w32
 :emacs-variant nil
 :build
 "--with-modules --without-dbus --with-native-compilation --without-compress-install CFLAGS=-O2"
 :os
 (:uname nil
     :lsb-release nil)
 :jupyter
 "Selected Jupyter core packages...
IPython          : 8.11.0
ipykernel        : 6.21.2
ipywidgets       : 8.0.4
jupyter_client   : 8.0.3
jupyter_core     : 5.2.0
jupyter_server   : 2.3.0
jupyterlab       : not installed
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.9.0
"
 :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 "20220911.1319"
       :source-dir "f:/Emacs/.emacs.d/elpa/ein-20220911.1319/")
 :lib
 ((:name "websocket"
     :path "~/.emacs.d/elpa/websocket-20230129.1601/websocket.elc"
     :featurep t
     :version-var websocket-version
     :version "1.12")
  (:name "anaphora"
     :path "~/.emacs.d/elpa/anaphora-20180618.2200/anaphora.elc"
     :featurep t
     :version-var nil
     :version nil)
  (:name "request"
     :path "~/.emacs.d/elpa/request-20230127.417/request.elc"
     :featurep t
     :version-var request-version
     :version "0.3.3")
  (:name "deferred"
     :path "~/.emacs.d/elpa/deferred-20170901.1330/deferred.elc"
     :featurep t
     :version-var deferred:version
     :version "0.5.0")
  (:name "polymode"
     :path "~/.emacs.d/elpa/polymode-20220820.1630/polymode.elc"
     :featurep t
     :version-var nil
     :version nil)
  (:name "dash"
     :path "~/.emacs.d/elpa/dash-20221013.836/dash.elc"
     :featurep t
     :version-var nil
     :version nil)
  (:name "with-editor"
     :path "~/.emacs.d/elpa/with-editor-20230212.2214/with-editor.elc"
     :featurep nil
     :version-var nil
     :version nil)))

Logs:

ein:log-all:

19:39:16:942: [warn] ein:jupyter-default-kernel: (json-readtable-error 207) @#<buffer *scratch*>
19:39:17:897: [info] ein:jupyter-server--run: d:/Python_env/help/Scripts/jupyter.exe notebook --notebook-dir=r:/jk --no-browser @#<buffer *scratch*>
19:39:20:186: [warn] Jupyter server failed to start, cancelling operation @#<buffer *scratch*>
19:44:23:387: [info] Login to http://127.0.0.1:8888 complete. @#<buffer *Messages*>
19:44:23:780: [verbose] Opening notebooklist at http://127.0.0.1:8888 @#<buffer *Messages*>
19:50:52:798: [warn] ein:dev-packages: Don’t call me! @#<buffer  *temp*>

ein server:

[I 19:39:19.136 NotebookApp] Serving notebooks from local directory: r:/jk
[I 19:39:19.136 NotebookApp] Jupyter Notebook 6.5.2 is running at:
[I 19:39:19.136 NotebookApp] http://localhost:8888/?token=0d9458db9f077ba47d6a385557e447964eccce37f16aebe0
[I 19:39:19.136 NotebookApp]  or http://127.0.0.1:8888/?token=0d9458db9f077ba47d6a385557e447964eccce37f16aebe0
[I 19:39:19.136 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 19:39:19.139 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///C:/Users/Neptune/AppData/Roaming/jupyter/runtime/nbserver-11892-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=0d9458db9f077ba47d6a385557e447964eccce37f16aebe0
     or http://127.0.0.1:8888/?token=0d9458db9f077ba47d6a385557e447964eccce37f16aebe0
[I 19:44:23.273 NotebookApp] 302 POST /login (127.0.0.1) 0.980000ms
[I 19:44:23.274 NotebookApp] 302 GET / (127.0.0.1) 0.000000ms
[W 19:44:23.431 NotebookApp] Serving api spec (experimental, incomplete)
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
dickmao commented 1 year ago

I have 0% confidence EIN works under Windows (noted in the README).

My confidence isn't that much higher for WSL, Linux or Mac.

Neptenu commented 1 year ago

I see, that's why yesterday i searched no same problem like me :joy: I found solution (try M-x ein:login) when i was editing this issue, so i pull it till