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 122 forks source link

invalid token near '/' #897

Closed dcguim closed 1 week ago

dcguim commented 1 week ago

Problem description

I am currently running into the following issue when running ein:run:

Debugger entered--Lisp error: (json-parse-error "invalid token near '/'" "<string>" 1 1 1)
  json-parse-string("/Users/dguim/Library/Python/3.9/lib/python/site-pa..." :object-type plist :array-type array :null-object nil :false-object :json-false)
  ein:jupyter-crib-running-servers()
  ein:jupyter-my-url-or-port()
  ein:run("/Users/dguim/Library/Python/3.9/bin/jupyter" "~/work/financeapp-back/" nil #f(compiled-function (buffer url-or-port) #<bytecode 0x1270b1f8176eae1d>) nil)
  funcall-interactively(ein:run "/Users/dguim/Library/Python/3.9/bin/jupyter" "~/work/financeapp-back/" nil #f(compiled-function (buffer url-or-port) #<bytecode 0x1270b1f8176eae1d>) nil)
  call-interactively(ein:run record nil)
  command-execute(ein:run record)
  execute-extended-command(nil "ein:run" "ein:run")
  funcall-interactively(execute-extended-command nil "ein:run" "ein:run")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

When calling ein:stop, I often get: ein:jupyter-crib-running-servers: could not parse JSON stream: "invalid token near '/'", "<string>", 1, 1, 1

System info:

ein:dev-sys-info erred: Package lacks a file header```
## Logs:
#### *ein:log-all*:

17:15:22:243: [info] ein:jupyter-server--run: /Users/dguim/Library/Python/3.9/bin/jupyter notebook --notebook-dir=~/work/financeapp-back/ --no-browser @#<buffer scratch>

#### *ein server*:

/Users/dguim/Library/Python/3.9/lib/python/site-packages/urllib3/init.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( [I 2024-11-13 17:15:23.242 ServerApp] jupyter_lsp | extension was successfully linked. [I 2024-11-13 17:15:23.246 ServerApp] jupyter_server_terminals | extension was successfully linked. [I 2024-11-13 17:15:23.249 ServerApp] jupyterlab | extension was successfully linked. [I 2024-11-13 17:15:23.252 ServerApp] notebook | extension was successfully linked. [I 2024-11-13 17:15:23.420 ServerApp] notebook_shim | extension was successfully linked. [I 2024-11-13 17:15:23.453 ServerApp] notebook_shim | extension was successfully loaded. [I 2024-11-13 17:15:23.455 ServerApp] jupyter_lsp | extension was successfully loaded. [I 2024-11-13 17:15:23.456 ServerApp] jupyter_server_terminals | extension was successfully loaded. [I 2024-11-13 17:15:23.458 LabApp] JupyterLab extension loaded from /Users/dguim/Library/Python/3.9/lib/python/site-packages/jupyterlab [I 2024-11-13 17:15:23.458 LabApp] JupyterLab application directory is /Users/dguim/Library/Python/3.9/share/jupyter/lab [I 2024-11-13 17:15:23.458 LabApp] Extension Manager is 'pypi'. [I 2024-11-13 17:15:23.470 ServerApp] jupyterlab | extension was successfully loaded. [I 2024-11-13 17:15:23.472 ServerApp] notebook | extension was successfully loaded. [I 2024-11-13 17:15:23.473 ServerApp] Serving notebooks from local directory: /Users/dguim/work/financeapp-back [I 2024-11-13 17:15:23.473 ServerApp] Jupyter Server 2.14.0 is running at: [I 2024-11-13 17:15:23.473 ServerApp] http://localhost:8888/tree?token=557018e8508f12201746794dbe5a206e08730549e29007e4 [I 2024-11-13 17:15:23.476 ServerApp] http://127.0.0.1:8888/tree?token=557018e8508f12201746794dbe5a206e08730549e29007e4 [I 2024-11-13 17:15:23.476 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-11-13 17:15:23.479 ServerApp]

To access the server, open this file in a browser:
    file:///Users/dguim/Library/Jupyter/runtime/jpserver-8620-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/tree?token=557018e8508f12201746794dbe5a206e08730549e29007e4
    http://127.0.0.1:8888/tree?token=557018e8508f12201746794dbe5a206e08730549e29007e4

[I 2024-11-13 17:15:24.181 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server

dcguim commented 1 week ago

Answering my question, it is due to a known problem in macOS with urllib2-v2. Downgrade to openssl@1.1 for a fix, vide: https://stackoverflow.com/questions/76187256/importerror-urllib3-v2-0-only-supports-openssl-1-1-1-currently-the-ssl-modu