JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.8k stars 413 forks source link

JupyterLab stopped working for Julia 1.9 (404 GETs) #1078

Open bingis-khan opened 1 year ago

bingis-khan commented 1 year ago

versioninfo()

Julia Version 1.9.0
Commit 8e63055292* (2023-05-07 11:25 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 8 × Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores

Installation

I used pacman. Also removed any dotfiles/directories for jupyter and julia. The issue still occurs. Everything is up-to-date.

Julia 1.8 would run without issues.


I try to create a Julia 1.9 notebook and try to run a simple code block, like:

println("asd")

This is the output:

[I 2023-05-29 11:57:00.673 ServerApp] Package jupyterlab took 0.0000s to import
[I 2023-05-29 11:57:00.676 ServerApp] Package jupyter_server_fileid took 0.0031s to import
[I 2023-05-29 11:57:00.697 ServerApp] Package jupyter_server_ydoc took 0.0207s to import
[I 2023-05-29 11:57:00.698 ServerApp] Package notebook_shim took 0.0000s to import
[W 2023-05-29 11:57:00.698 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-05-29 11:57:00.701 ServerApp] jupyter_server_fileid | extension was successfully linked.
[I 2023-05-29 11:57:00.705 ServerApp] jupyter_server_ydoc | extension was successfully linked.
[I 2023-05-29 11:57:00.711 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-05-29 11:57:00.875 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-05-29 11:57:00.889 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-05-29 11:57:00.889 FileIdExtension] Configured File ID manager: ArbitraryFileIdManager
[I 2023-05-29 11:57:00.890 FileIdExtension] ArbitraryFileIdManager : Configured root dir: /home/bob
[I 2023-05-29 11:57:00.890 FileIdExtension] ArbitraryFileIdManager : Configured database path: /home/bob/.local/share/jupyter/file_id_manager.db
[I 2023-05-29 11:57:00.890 FileIdExtension] ArbitraryFileIdManager : Successfully connected to database file.
[I 2023-05-29 11:57:00.890 FileIdExtension] ArbitraryFileIdManager : Creating File ID tables and indices with journal_mode = DELETE
[I 2023-05-29 11:57:00.890 FileIdExtension] Attached event listeners.
[I 2023-05-29 11:57:00.890 ServerApp] jupyter_server_fileid | extension was successfully loaded.
[I 2023-05-29 11:57:00.891 ServerApp] jupyter_server_ydoc | extension was successfully loaded.
[I 2023-05-29 11:57:00.891 LabApp] JupyterLab extension loaded from /usr/lib/python3.11/site-packages/jupyterlab
[I 2023-05-29 11:57:00.891 LabApp] JupyterLab application directory is /usr/share/jupyter/lab
[I 2023-05-29 11:57:00.891 LabApp] Extension Manager is 'pypi'.
[I 2023-05-29 11:57:00.893 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-05-29 11:57:00.894 ServerApp] Serving notebooks from local directory: /home/bob
[I 2023-05-29 11:57:00.894 ServerApp] Jupyter Server 2.6.0 is running at:
[I 2023-05-29 11:57:00.894 ServerApp] http://localhost:8888/lab?token=cd74d35ec702a5d2153dd7a8b6e9d5abbaaf7a8ad7f26d49
[I 2023-05-29 11:57:00.894 ServerApp]     http://127.0.0.1:8888/lab?token=cd74d35ec702a5d2153dd7a8b6e9d5abbaaf7a8ad7f26d49
[I 2023-05-29 11:57:00.894 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-05-29 11:57:01.237 ServerApp] 

    To access the server, open this file in a browser:
        file:///home/bob/.local/share/jupyter/runtime/jpserver-16737-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=cd74d35ec702a5d2153dd7a8b6e9d5abbaaf7a8ad7f26d49
        http://127.0.0.1:8888/lab?token=cd74d35ec702a5d2153dd7a8b6e9d5abbaaf7a8ad7f26d49
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.
[W 2023-05-29 11:57:03.543 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354223435 (127.0.0.1): Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208
[W 2023-05-29 11:57:03.543 ServerApp] wrote error: 'Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208'
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208)
[W 2023-05-29 11:57:03.545 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354223435 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 48.39ms referer=http://localhost:8888/lab/workspaces/auto-7/tree/Untitled.ipynb
[W 2023-05-29 11:57:05.742 ServerApp] 404 GET /lsp/status?1685354225720 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 19.20ms referer=http://localhost:8888/lab/workspaces/auto-Y?reset
[I 2023-05-29 11:57:06.204 LabApp] Build is up to date
[I 2023-05-29 11:57:18.866 ServerApp] Creating new notebook in 
[I 2023-05-29 11:57:19.270 ServerApp] Kernel started: 2eb3c431-7a1a-4337-9807-13d931e886ba
[W 2023-05-29 11:57:21.447 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354241444 (127.0.0.1): Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208
[W 2023-05-29 11:57:21.447 ServerApp] wrote error: 'Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208'
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208)
[W 2023-05-29 11:57:21.448 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354241444 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 1.56ms referer=http://localhost:8888/lab/workspaces/auto-7/tree/Untitled.ipynb
Starting kernel event loops.
[W 2023-05-29 11:57:52.914 ServerApp] 404 GET /api/kernels/81d468d6-ef64-484b-afb6-3d273a348420/channels?session_id=95154621-8e7b-4a0a-81dc-5c4b14145b87 (127.0.0.1): Kernel does not exist: 81d468d6-ef64-484b-afb6-3d273a348420
[W 2023-05-29 11:57:52.917 ServerApp] 404 GET /api/kernels/81d468d6-ef64-484b-afb6-3d273a348420/channels?session_id=95154621-8e7b-4a0a-81dc-5c4b14145b87 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 3.58ms referer=None
[W 2023-05-29 11:57:52.925 ServerApp] 404 GET /api/kernels/81d468d6-ef64-484b-afb6-3d273a348420?1685354272922 (127.0.0.1): Kernel does not exist: 81d468d6-ef64-484b-afb6-3d273a348420
[W 2023-05-29 11:57:52.926 ServerApp] wrote error: 'Kernel does not exist: 81d468d6-ef64-484b-afb6-3d273a348420'
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: 81d468d6-ef64-484b-afb6-3d273a348420)
[W 2023-05-29 11:57:52.927 ServerApp] 404 GET /api/kernels/81d468d6-ef64-484b-afb6-3d273a348420?1685354272922 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 1.76ms referer=http://localhost:8888/lab/workspaces/auto-r/tree/test.ipynb
[W 2023-05-29 11:58:52.957 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208/channels?session_id=b1fbf67e-d109-4aa4-a9fa-780eff604a70 (127.0.0.1): Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208
[W 2023-05-29 11:58:52.958 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208/channels?session_id=b1fbf67e-d109-4aa4-a9fa-780eff604a70 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 1.51ms referer=None
[W 2023-05-29 11:58:52.964 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354332960 (127.0.0.1): Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208
[W 2023-05-29 11:58:52.964 ServerApp] wrote error: 'Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208'
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208)
[W 2023-05-29 11:58:52.965 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354332960 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 1.65ms referer=http://localhost:8888/lab/workspaces/auto-7/tree/Untitled.ipynb
[W 2023-05-29 11:58:53.218 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208/channels?session_id=ed8bf78e-bf52-4b7c-8a50-3add53bb8e4b (127.0.0.1): Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208
[W 2023-05-29 11:58:53.221 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208/channels?session_id=ed8bf78e-bf52-4b7c-8a50-3add53bb8e4b (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 3.90ms referer=None
[W 2023-05-29 11:58:53.234 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354333225 (127.0.0.1): Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208
[W 2023-05-29 11:58:53.234 ServerApp] wrote error: 'Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208'
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: dc36cacb-9096-44d3-a08d-05205c620208)
[W 2023-05-29 11:58:53.236 ServerApp] 404 GET /api/kernels/dc36cacb-9096-44d3-a08d-05205c620208?1685354333225 (7dc2de4f5a7d4d7785cdd2824fd34ff0@127.0.0.1) 3.70ms referer=http://localhost:8888/lab/workspaces/auto-7/tree/Untitled.ipynb
[I 2023-05-29 11:59:19.597 ServerApp] Saving file at /Untitled.ipynb
[I 2023-05-29 11:59:46.674 ServerApp] interrupted
[I 2023-05-29 11:59:46.675 ServerApp] Serving notebooks from local directory: /home/bob
    1 active kernel
    Jupyter Server 2.6.0 is running at:
    http://localhost:8888/lab?token=cd74d35ec702a5d2153dd7a8b6e9d5abbaaf7a8ad7f26d49
        http://127.0.0.1:8888/lab?token=cd74d35ec702a5d2153dd7a8b6e9d5abbaaf7a8ad7f26d49
Shutdown this Jupyter server (y/[n])? [C 2023-05-29 11:59:49.299 ServerApp] Shutdown confirmed
[I 2023-05-29 11:59:49.300 ServerApp] Shutting down 4 extensions
[I 2023-05-29 11:59:49.301 ServerApp] Shutting down 1 kernel
[I 2023-05-29 11:59:49.302 ServerApp] Kernel shutdown: 2eb3c431-7a1a-4337-9807-13d931e886ba
lairez commented 1 year ago

Same here. Maybe specific to Arch Linux.

stevengj commented 1 year ago

"Kernel does not exist" makes it sound like you need to re-build IJulia to ensure that the correct kernel file is installed (for the default Julia environment, not just in a particular project).

bvdmitri commented 1 year ago

Jupyter notebook stopped working for me recently. The error on start-up shows

[I 21:10:16.252 NotebookApp] KernelRestarter: restarting kernel (5/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia [7073ff75-c697-5162-941a-fcdaad2a7d2a] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

Stacktrace:
 [1] _require(pkg::Base.PkgId, env::String)
   @ Base ./loading.jl:1739
 [2] _require_prelocked(uuidkey::Base.PkgId, env::String)
   @ Base ./loading.jl:1625
 [3] macro expansion
   @ ./loading.jl:1613 [inlined]
 [4] macro expansion
   @ ./lock.jl:267 [inlined]
 [5] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1576
in expression starting at /Users/bvdmitri/.julia/packages/IJulia/Vo51o/src/kernel.jl:1
[W 21:10:19.272 NotebookApp] KernelRestarter: restart failed

I tried re-installing and re-building the IJulia without luck.

bvdmitri commented 1 year ago

After removing the kernel with the jupyter kernelspec remove julia-1.9 and re-installing it with the using IJulia; installkernel("julia") I get the exact same error as @bingis-khan.

[W 2023-06-04 21:22:48.751 ServerApp] wrote error: 'Kernel does not exist: a81c57c6-849e-466b-87e4-a2cee91f773e'
    Traceback (most recent call last):
      File "/opt/homebrew/lib/python3.10/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
      File "/opt/homebrew/lib/python3.10/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
      File "/opt/homebrew/lib/python3.10/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/opt/homebrew/lib/python3.10/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: a81c57c6-849e-466b-87e4-a2cee91f773e)
amic-github commented 1 year ago

Same issue here, after last update of my Arch Linux distribution. Could not get it work by downgrading julia to 1.8, neither managed to roll back to other versions of jupyter. So it is very problematic. Here is the log with IJulia in verbose mode, and trying to install a new kernel in the global Julia environment (nothing changed).

    To access the server, open this file in a browser:
        file:///home/amic/.local/share/jupyter/runtime/jpserver-29254-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=e561000347b2b4bc0f9a0ce115c247c8e8e15002c00055b2
        http://127.0.0.1:8888/lab?token=e561000347b2b4bc0f9a0ce115c247c8e8e15002c00055b2
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.
[W 2023-06-18 22:40:29.361 ServerApp] 404 GET /lsp/status?1687120829334 (0c7e45e9469442cdb43ebee9998a459f@127.0.0.1) 25.02ms referer=http://localhost:8888/lab/workspaces/auto-q?reset
[W 2023-06-18 22:40:29.363 ServerApp] 404 GET /api/kernels/322cddd1-57a7-4f74-bf7d-30351e954b5f?1687120829350 (127.0.0.1): Kernel does not exist: 322cddd1-57a7-4f74-bf7d-30351e954b5f
[W 2023-06-18 22:40:29.363 ServerApp] wrote error: 'Kernel does not exist: 322cddd1-57a7-4f74-bf7d-30351e954b5f'
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/handlers.py", line 73, in get
        model = await ensure_async(km.kernel_model(kernel_id))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 501, in kernel_model
        self._check_kernel_id(kernel_id)
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 532, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: 322cddd1-57a7-4f74-bf7d-30351e954b5f)
[W 2023-06-18 22:40:29.365 ServerApp] 404 GET /api/kernels/322cddd1-57a7-4f74-bf7d-30351e954b5f?1687120829350 (0c7e45e9469442cdb43ebee9998a459f@127.0.0.1) 3.10ms referer=http://localhost:8888/lab
[I 2023-06-18 22:40:30.176 LabApp] Build is up to date
[I 2023-06-18 22:40:38.568 ServerApp] Kernel started: 67f8faa1-4f12-4fab-960a-dd203549f5c6
PROFILE = Dict{String, Any}("key" => "8475a699-a539c6db4e74d00d03d978d5", "transport" => "tcp", "signature_scheme" => "hmac-sha256", "shell_port" => 55549, "hb_port" => 59755, "control_port" => 55715, "ip" => "127.0.0.1", "stdin_port" => 47465, "iopub_port" => 55027, "kernel_name" => "julia-test-1.9")
22:40:41(): SENDING IPython Msg [ idents status ] {
  parent_header = Dict("username" => "jlkernel", "session" => "acf2dc73-e2b9-4339-9601-4851bad5e9e0"),
  header = Dict{String, Any}("msg_id" => "221dc876-7bc8-4c0c-8144-d7fa880217ac", "msg_type" => "status", "username" => "jlkernel", "date" => Dates.DateTime("2023-06-18T22:40:41.249"), "version" => "5.3", "session" => "acf2dc73-e2b9-4339-9601-4851bad5e9e0"),
  metadata = Dict{String, Any}(),
  content = Dict("execution_state" => "starting")
}
[E 2023-06-18 22:40:41.901 ServerApp] Uncaught exception in ZMQStream callback
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 558, in record_activity
        msg = session.deserialize(fed_msg_list, content=False)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_client/session.py", line 1070, in deserialize
        raise ValueError(msg)
    ValueError: Invalid Signature: b'64c87271af4442e0fef7f39810595d445a8eb593bfd07a0b149b41bb411004a907aa1f59e7b5b745a1790b6cc9c93ae46766ee51a1ac59dd217302ed781d676f'
[E 2023-06-18 22:40:41.902 ServerApp] Uncaught exception in zmqstream callback
    Traceback (most recent call last):
      File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
        self._handle_recv()
      File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
        self._run_callback(callback, msg)
      File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
        f = callback(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 558, in record_activity
        msg = session.deserialize(fed_msg_list, content=False)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/site-packages/jupyter_client/session.py", line 1070, in deserialize
        raise ValueError(msg)
    ValueError: Invalid Signature: b'64c87271af4442e0fef7f39810595d445a8eb593bfd07a0b149b41bb411004a907aa1f59e7b5b745a1790b6cc9c93ae46766ee51a1ac59dd217302ed781d676f'
Exception in callback BaseAsyncIOLoop._handle_events(20, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(20, 1)>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 206, in _handle_events
    handler_func(fileobj, events)
  File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 634, in _handle_events
    self._handle_recv()
  File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 663, in _handle_recv
    self._run_callback(callback, msg)
  File "/usr/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 584, in _run_callback
    f = callback(*args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/jupyter_server/services/kernels/kernelmanager.py", line 558, in record_activity
    msg = session.deserialize(fed_msg_list, content=False)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/jupyter_client/session.py", line 1070, in deserialize
    raise ValueError(msg)
ValueError: Invalid Signature: b'64c87271af4442e0fef7f39810595d445a8eb593bfd07a0b149b41bb411004a907aa1f59e7b5b745a1790b6cc9c93ae46766ee51a1ac59dd217302ed781d676f'
Starting kernel event loops.
amic-github commented 1 year ago

Finally managed to find a solution.

All of this is probably due to the archlinux julia package. As noted in the documentation of the package, it is unsupported : https://wiki.archlinux.org/title/Julia

The official way, through the package juliaup in AUR, worked for me. I was able to install the LTS and make IJulia work. Then I also did juliaup add release to get the 1.9.1 and it worked. IJulia was now working.

SimonMaenaut commented 1 year ago

Indeed, I can confirm that the Julia kernel for Jupyter notebook / labs doesn't seem work with the julia 1.9.1 package in archlinux, and does seem to work with the julia-bin 1.9.1 package (from the AUR) based on the official builds.

Screenshot from 2023-06-25 16-22-48

fortunewalla commented 11 months ago

It was working before on all 1.85, 1.9 & 1.11 but does not work now. Perhaps due to updating a bunch of packages related to jupyter & ipython??? 🤔

ipykernel                         6.27.1
ipython                           8.18.1
ipython-genutils                  0.2.0
jupyter                           1.0.0
jupyter-cache                     1.0.0
jupyter_client                    8.6.0
jupyter-console                   6.6.3
jupyter-contrib-core              0.4.2
jupyter-contrib-nbextensions      0.7.0
jupyter_core                      5.5.0
jupyter-events                    0.9.0
jupyter-highlight-selected-word   0.2.0
jupyter-lsp                       2.2.1
jupyter-nbextensions-configurator 0.6.3
jupyter_server                    2.11.1
jupyter_server_terminals          0.4.4
jupyterlab                        4.1.0a3
jupyterlab_pygments               0.3.0
jupyterlab_server                 2.25.2
jupyterlab-widgets                3.0.9
nbclassic                         1.0.0
nbclient                          0.9.0
nbconvert                         7.11.0
nbformat                          5.9.2
notebook                          7.1.0a0
notebook_shim                     0.2.3

Tried the latest nightly also julia 1.11, same errors.

Windows 10 64-bit

(q) pkg> st
Status `C:\julia\q\Project.toml`
  [7073ff75] IJulia v1.24.2

versioninfo()

Julia Version 1.9.4
Commit 8e5136fa29 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i5-5320 CPU @ 2.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 2 on 2 virtual cores
Environment:
  JULIA_DEPOT_PATH = C:\julia\.julia
  JULIA_NUM_THREADS = 2
  JULIA_PROJECT = C:\julia\q

Tried from console

jupyter console --kernel julia-1.9
C:\conda\envs\jupyter\lib\site-packages\zmq\_future.py:679: RuntimeWarning: 
Proactor event loop does not implement add_reader family of methods required 
for zmq. Registering an additional selector thread for add_reader support via 
tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` 
to avoid this warning.
  self._get_loop()

ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
Traceback (most recent call last):
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\ptshell.py", line 434, in init_kernel_info
    reply = self.client.get_shell_msg(timeout=1)
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_core\utils\__init__.py", line 173, in wrapped
    return loop.run_until_complete(inner)
  File "C:\conda\envs\jupyter\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_client\client.py", line 143, in _async_get_shell_msg
    return await ensure_async(self.shell_channel.get_msg(*args, **kwargs))
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_client\channels.py", line 233, in get_msg
    raise Empty
_queue.Empty

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\conda\envs\jupyter\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\conda\envs\jupyter\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\conda\envs\jupyter\Scripts\jupyter-console.EXE\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_core\application.py", line 280, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "C:\conda\envs\jupyter\lib\site-packages\traitlets\config\application.py", line 1076, in launch_instance
    app.initialize(argv)
  File "C:\conda\envs\jupyter\lib\site-packages\traitlets\config\application.py", line 118, in inner
    return method(app, *args, **kwargs)
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\app.py", line 136, in initialize
    self.init_shell()
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\app.py", line 106, in init_shell
    self.shell = ZMQTerminalInteractiveShell.instance(parent=self,
  File "C:\conda\envs\jupyter\lib\site-packages\traitlets\config\configurable.py", line 583, in instance
    inst = cls(*args, **kwargs)
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\ptshell.py", line 352, in __init__
    self.init_kernel_info()
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\ptshell.py", line 437, in init_kernel_info
    raise RuntimeError("Kernel didn't respond to kernel_info_request") from e
RuntimeError: Kernel didn't respond to kernel_info_request

From Jupyter Notebook

[I 2023-11-30 18:50:30.283 ServerApp] Jupyter Server 2.11.1 is running at:
[I 2023-11-30 18:50:30.283 ServerApp] http://localhost:8888/
[I 2023-11-30 18:50:30.288 ServerApp]     http://127.0.0.1:8888/
[I 2023-11-30 18:50:30.288 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2023-11-30 18:50:31.885 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, python-lsp-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
[I 2023-11-30 18:52:05.722 ServerApp] Kernel started: 8b77acb4-c76c-4767-95b2-17417cb3f535
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
[I 2023-11-30 18:52:09.018 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (1/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
[I 2023-11-30 18:52:12.038 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (2/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
[I 2023-11-30 18:52:15.134 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (3/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
[I 2023-11-30 18:52:18.251 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (4/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
[I 2023-11-30 18:52:21.282 ServerApp] AsyncIOLoopKernelRestarter: restarting kernel (5/5), new random ports
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ .\loading.jl:1630 [inlined]
 [2] macro expansion
   @ .\lock.jl:267 [inlined]
 [3] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1611
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
[W 2023-11-30 18:52:24.306 ServerApp] AsyncIOLoopKernelRestarter: restart failed
[W 2023-11-30 18:52:24.307 ServerApp] Kernel 8b77acb4-c76c-4767-95b2-17417cb3f535 died, removing from map.
[W 2023-11-30 18:52:26.044 ServerApp] 404 GET /api/kernels/8b77acb4-c76c-4767-95b2-17417cb3f535?1701350546038 (127.0.0.1): Kernel does not exist: 8b77acb4-c76c-4767-95b2-17417cb3f535
[W 2023-11-30 18:52:26.044 ServerApp] wrote error: 'Kernel does not exist: 8b77acb4-c76c-4767-95b2-17417cb3f535'
    Traceback (most recent call last):
      File "C:\conda\envs\jupyter\lib\site-packages\tornado\web.py", line 1786, in _execute
        result = await result
      File "C:\conda\envs\jupyter\lib\site-packages\jupyter_server\services\kernels\handlers.py", line 75, in get
        model = await ensure_async(km.kernel_model(kernel_id))
      File "C:\conda\envs\jupyter\lib\site-packages\jupyter_server\services\kernels\kernelmanager.py", line 500, in kernel_model
        self._check_kernel_id(kernel_id)
      File "C:\conda\envs\jupyter\lib\site-packages\jupyter_server\services\kernels\kernelmanager.py", line 531, in _check_kernel_id
        raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
    tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: 8b77acb4-c76c-4767-95b2-17417cb3f535)
[W 2023-11-30 18:52:26.054 ServerApp] 404 GET /api/kernels/8b77acb4-c76c-4767-95b2-17417cb3f535?1701350546038 (a4887cdef6614e1592ada31483b282ff@127.0.0.1) 10.00ms referer=http://127.0.0.1:8888/notebooks/julia185.ipynb
[W 2023-11-30 18:53:05.754 ServerApp] Timeout waiting for kernel_info reply from 8b77acb4-c76c-4767-95b2-17417cb3f535
[I 2023-11-30 18:53:05.755 ServerApp] Connecting to kernel 8b77acb4-c76c-4767-95b2-17417cb3f535. [W 2023-11-30 18:53:05.765 ServerApp] 404 GET /api/kernels/8b77acb4-c76c-4767-95b2-17417cb3f535/channels?session_id=8782cb09-4fb9-4223-9e47-1b02f437da0c (127.0.0.1): Kernel does not exist: 8b77acb4-c76c-4767-95b2-17417cb3f535
fortunewalla commented 11 months ago

It finally worked 😎 but the steps I did were perhaps totally random.

UPDATE: FOUND WHY IT WORKS or DOESN"T in my machine:

if I start jupyter within JULIA root directory(after adding path), it works fine. If I start jupyter anywhere else(even after adding path), it gives the below errors. Not sure if this is the default behavior or not? 🤔

Checked if any updates to nbconvert ✔️

(jupyter) C:\conda>pip install -U --pre nbconvert
Requirement already satisfied: nbconvert in C:\conda\envs\jupyter\lib\site-packages (7.13.0)
Collecting nbconvert
  Downloading nbconvert-7.13.1-py3-none-any.whl.metadata (7.7 kB)
Requirement already satisfied: beautifulsoup4 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (4.12.2)
Requirement already satisfied: bleach!=5.0.0 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (6.1.0)
Requirement already satisfied: defusedxml in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (0.7.1)
Requirement already satisfied: jinja2>=3.0 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (3.1.2)
Requirement already satisfied: jupyter-core>=4.7 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (5.5.1)
Requirement already satisfied: jupyterlab-pygments in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (0.3.0)
Requirement already satisfied: markupsafe>=2.0 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (2.1.3)
Requirement already satisfied: mistune<4,>=2.0.3 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (3.0.2)
Requirement already satisfied: nbclient>=0.5.0 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (0.9.0)
Requirement already satisfied: nbformat>=5.7 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (5.9.2)
Requirement already satisfied: packaging in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (23.1)
Requirement already satisfied: pandocfilters>=1.4.1 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (1.5.0)
Requirement already satisfied: pygments>=2.4.1 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (2.17.2)
Requirement already satisfied: tinycss2 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (1.2.1)
Requirement already satisfied: traitlets>=5.1 in C:\conda\envs\jupyter\lib\site-packages (from nbconvert) (5.14.0)
Requirement already satisfied: six>=1.9.0 in C:\conda\envs\jupyter\lib\site-packages (from bleach!=5.0.0->nbconvert) (1.16.0)
Requirement already satisfied: webencodings in C:\conda\envs\jupyter\lib\site-packages (from bleach!=5.0.0->nbconvert) (0.5.1)
Requirement already satisfied: platformdirs>=2.5 in C:\conda\envs\jupyter\lib\site-packages (from jupyter-core>=4.7->nbconvert) (3.10.0)
Requirement already satisfied: pywin32>=300 in C:\conda\envs\jupyter\lib\site-packages (from jupyter-core>=4.7->nbconvert) (306)
Requirement already satisfied: jupyter-client>=6.1.12 in C:\conda\envs\jupyter\lib\site-packages (from nbclient>=0.5.0->nbconvert) (8.6.0)
Requirement already satisfied: fastjsonschema in C:\conda\envs\jupyter\lib\site-packages (from nbformat>=5.7->nbconvert) (2.18.1)
Requirement already satisfied: jsonschema>=2.6 in C:\conda\envs\jupyter\lib\site-packages (from nbformat>=5.7->nbconvert) (4.19.1)
Requirement already satisfied: soupsieve>1.2 in C:\conda\envs\jupyter\lib\site-packages (from beautifulsoup4->nbconvert) (2.5)
Requirement already satisfied: attrs>=22.2.0 in C:\conda\envs\jupyter\lib\site-packages (from jsonschema>=2.6->nbformat>=5.7->nbconvert) (23.1.0)
Requirement already satisfied: jsonschema-specifications>=2023.03.6 in C:\conda\envs\jupyter\lib\site-packages (from jsonschema>=2.6->nbformat>=5.7->nbconvert) (2023.7.1)
Requirement already satisfied: referencing>=0.28.4 in C:\conda\envs\jupyter\lib\site-packages (from jsonschema>=2.6->nbformat>=5.7->nbconvert) (0.30.2)
Requirement already satisfied: rpds-py>=0.7.1 in C:\conda\envs\jupyter\lib\site-packages (from jsonschema>=2.6->nbformat>=5.7->nbconvert) (0.10.0)
Requirement already satisfied: python-dateutil>=2.8.2 in C:\conda\envs\jupyter\lib\site-packages (from jupyter-client>=6.1.12->nbclient>=0.5.0->nbconvert) (2.8.2)
Requirement already satisfied: pyzmq>=23.0 in C:\conda\envs\jupyter\lib\site-packages (from jupyter-client>=6.1.12->nbclient>=0.5.0->nbconvert) (25.1.2)
Requirement already satisfied: tornado>=6.2 in C:\conda\envs\jupyter\lib\site-packages (from jupyter-client>=6.1.12->nbclient>=0.5.0->nbconvert) (6.4)
Downloading nbconvert-7.13.1-py3-none-any.whl (256 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 256.6/256.6 kB 450.4 kB/s eta 0:00:00
Installing collected packages: nbconvert
  Attempting uninstall: nbconvert
    Found existing installation: nbconvert 7.13.0
    Uninstalling nbconvert-7.13.0:
      Successfully uninstalled nbconvert-7.13.0

Successfully installed nbconvert-7.13.1

Tried to check if Julia kernel can be run through jupyter ⛔

(jupyter) C:\conda>jupyter console --kernel julia-1.11
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ Base .\loading.jl:1847 [inlined]
 [2] macro expansion
   @ Base .\lock.jl:267 [inlined]
 [3] __require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1828
 [4] #invoke_in_world#3
   @ Base .\essentials.jl:989 [inlined]
 [5] invoke_in_world
   @ Base .\essentials.jl:986 [inlined]
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1821
in expression starting at C:\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1
Traceback (most recent call last):
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\ptshell.py", line 434, in init_kernel_info
    reply = self.client.get_shell_msg(timeout=1)
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_core\utils\__init__.py", line 172, in wrapped
    return loop.run_until_complete(inner)
  File "C:\conda\envs\jupyter\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_client\client.py", line 143, in _async_get_shell_msg
    return await ensure_async(self.shell_channel.get_msg(*args, **kwargs))
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_client\channels.py", line 233, in get_msg
    raise Empty
_queue.Empty

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\conda\envs\jupyter\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\conda\envs\jupyter\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\conda\envs\jupyter\Scripts\jupyter-console.EXE\__main__.py", line 7, in <module>
    sys.exit(main())
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_core\application.py", line 281, in launch_instance
    super().launch_instance(argv=argv, **kwargs)
  File "C:\conda\envs\jupyter\lib\site-packages\traitlets\config\application.py", line 1076, in launch_instance
    app.initialize(argv)
  File "C:\conda\envs\jupyter\lib\site-packages\traitlets\config\application.py", line 118, in inner
    return method(app, *args, **kwargs)
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\app.py", line 136, in initialize
    self.init_shell()
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\app.py", line 106, in init_shell
    self.shell = ZMQTerminalInteractiveShell.instance(parent=self,
  File "C:\conda\envs\jupyter\lib\site-packages\traitlets\config\configurable.py", line 583, in instance
    inst = cls(*args, **kwargs)
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\ptshell.py", line 352, in __init__
    self.init_kernel_info()
  File "C:\conda\envs\jupyter\lib\site-packages\jupyter_console\ptshell.py", line 437, in init_kernel_info
    raise RuntimeError("Kernel didn't respond to kernel_info_request") from e
RuntimeError: Kernel didn't respond to kernel_info_request

(jupyter) C:\conda>julia notebook list
'julia' is not recognized as an internal or external command,
operable program or batch file.

(jupyter) C:\conda>jupyter notebook list
Currently running servers:
http://localhost:8888/ :: C:\julia

(jupyter) C:\conda>

Tried to figure out if any new IJulia updates have occured or not. ⛔

C:\julia>julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.0-DEV.1093 (2023-12-14)
 _/ |\__'_|_|_|\__'_|  |  Commit 0ae209488f (8 days old master)

(q) pkg> st
  [7073ff75] IJulia v1.24.2

(q) pkg> instantiate

(q) pkg> up
    Updating registry at `C:\julia\.julia\registries\General.toml`
  No Changes to `C:\julia\q\Project.toml`
    Updating `C:\julia\q\Manifest.toml`
Precompiling project...
  4 dependencies successfully precompiled in 28 seconds. 37 already precompiled.
        Info We haven't cleaned this depot up for a bit, running Pkg.gc()...
      Active manifest files: 1 found
      Active artifact files: 2 found
      Active scratchspaces: 2 found
     Deleted no artifacts, repos, packages or scratchspaces

(q) pkg> precompile

(q) pkg> build
    Building Conda ─→ `C:\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\51cab8e982c5b598eea9c8ceaced4b58d9dd37c9\build.log`
    Building IJulia → `C:\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\47ac8cc196b81001a711f4b2c12c97372338f00c\build.log`

julia> using IJulia;

(q) pkg> build IJulia
    Building Conda ─→ `C:\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\51cab8e982c5b598eea9c8ceaced4b58d9dd37c9\build.log`
    Building IJulia → `C:\julia\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\47ac8cc196b81001a711f4b2c12c97372338f00c\build.log`

julia> exit()

C:\julia>

Tried to run julia kernel through jupyter again. ✔️

C:\julia>conda activate jupyter

(jupyter) C:\julia>jupyter kernelspec list
Available kernels:
  python3                C:\conda\envs\jupyter\share\jupyter\kernels\python3
  julia-1.11             C:\Users\julius\AppData\Roaming\jupyter\kernels\julia-1.11

(jupyter) C:\julia>

(jupyter) C:\julia>

(jupyter) C:\julia>explorer C:\Users\julius\AppData\Roaming\jupyter\kernels\

(jupyter) C:\julia>jupyter console --kernel julia-1.11
Starting kernel event loops.
Jupyter console 6.6.3

Julia: A fresh approach to technical computing.
In [1]: 1+1
Out[1]: 2

In [2]: VERSION
Out[2]: v"1.11.0-DEV.1093"

In [3]: versioninfo()
Julia Version 1.11.0-DEV.1093
Commit 0ae209488f (2023-12-14 05:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  ...
stevengj commented 11 months ago

It seems like people are reporting multiple unrelated problems in this issue, which isn't very productive.

e.g. "Package IJulia not found in current path." probably means that IJulia wasn't installed into your default environment, the one that is used when launching julia.

Whereas "kernel not found" means that somehow you installed a kernel that refers to the wrong path for Julia.

In both cases you could look into the kernels/julia-1.xx/kernel.json file to see what path and command-line options / environment it is using to launch Julia. (Note that Jupyter launches executables directly, I think, and may not be using your shell, so if there are any crucial environment variables that you need to you will needs to specify them in the kernel.json file under "env".)

fortunewalla commented 11 months ago

It seems like people are reporting multiple unrelated problems in this issue, which isn't very productive.

Sorry. I wasn't aware of the nuanced rules about this issue. I felt this was an already open issue & would get more eyeballs in case others needed another perspective on the problem. Also I'm a complete newbie to Julia & coding.

As mentioned above, the whole problem goes away when I start in jupyter in the root dir of Julia. If I start jupyter anywhere else, it gives those errors.

This is my kernel.json file.

{
  "display_name": "Julia 1.11.0-DEV",
  "argv": [
    "C:\\julia\\bin\\julia.exe",
    "-i",
    "--color=yes",
    "--project=q",
    "C:\\julia\\.julia\\packages\\IJulia\\Vo51o\\src\\kernel.jl",
    "{connection_file}"
  ],
  "language": "julia",
  "env": {},
  "interrupt_mode": "message"
}
stevengj commented 11 months ago

Do you have multiple Julia environments set up? Is IJulia installed in the global environment (see here on how to switch to the global environment)?

fortunewalla commented 11 months ago

Hi Steve, Thanks for the follow up. Appreciate it.🙏🏻

tldr: start

I checked whatever you said. Yes, IJulia is not installed in the global environment of Julia. I wanted to keep the global environment clean & start off with a q environment instead.

So I tested for global and Yes, if I install IJulia in the global enviroment, jupyter starts with Julia kernel in any directory but if I install IJulia in a project q, it only starts within the Julia root directory.

I'm not sure why it should affect jupyter. Although, I feel somewhere something project path related to kernel.jl is hardcoded.🤔 as line 1 of kernel.jl itself gives error.

tldr: end

Also I have not used julia to install either conda or jupyter notebook but installed them separately in another directory.

(jupyter) C:\conda>jupyter --version
Selected Jupyter core packages...
IPython          : 8.19.0
ipykernel        : 6.27.1
ipywidgets       : 8.1.1
jupyter_client   : 8.6.0
jupyter_core     : 5.5.1
jupyter_server   : 2.12.1
jupyterlab       : 4.1.0a4
nbclient         : 0.9.0
nbconvert        : 7.13.1
nbformat         : 5.9.2
notebook         : 7.1.0a1
qtconsole        : 5.5.1
traitlets        : 5.14.0

================

Case 1: IJulia installed in global environment & therefore Julia kernel works in any directory.

C:\julia>more juliapath.bat
echo off
set path=C:\julia\bin;%path%
set JULIA_DEPOT_PATH=C:\julia\.julia
set JULIA_NUM_THREADS=%NUMBER_OF_PROCESSORS%

start jupyter in any directory

(jupyter) C:\conda>jupyter console --kernel julia-1.11
Starting kernel event loops.
Jupyter console 6.6.3

Julia: A fresh approach to technical computing.
In [1]: 1+1
Out[1]: 2

In [2]:
Do you really want to exit ([y]/n)?
Shutting down kernel

(jupyter) C:\conda>

Case 2: IJulia is installed in q project or environment but Julia kernel starts only in root Julia directory & not in any other directory.

C:\julia>more juliapath.bat
echo off
set path=C:\julia\bin;%path%
set JULIA_DEPOT_PATH=C:\julia\.julia
set JULIA_NUM_THREADS=%NUMBER_OF_PROCESSORS%
set JULIA_PROJECT=C:\julia\q

If I start Julia within bin, it gives error.

(jupyter) C:\sw\julia\bin>jupyter console --kernel julia-1.11
ERROR: LoadError: ArgumentError: Package IJulia not found in current path.
- Run `import Pkg; Pkg.add("IJulia")` to install the IJulia package.
Stacktrace:
 [1] macro expansion
   @ Base .\loading.jl:1847 [inlined]
 [2] macro expansion
   @ Base .\lock.jl:267 [inlined]
 [3] __require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1828
 [4] #invoke_in_world#3
   @ Base .\essentials.jl:989 [inlined]
 [5] invoke_in_world
   @ Base .\essentials.jl:986 [inlined]
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:1821
in expression starting at C:\sw\julia\.julia\packages\IJulia\Vo51o\src\kernel.jl:1

But if I start jupyter within C:\julia it works fine.

I feel somewhere something related to kernel.jl is hardcoded.🤔

(jupyter) C:\sw\julia\bin>cd ..

(jupyter) C:\sw\julia>jupyter console --kernel julia-1.11
Starting kernel event loops.
Jupyter console 6.6.3

Julia: A fresh approach to technical computing.
In [1]: 1+1
Out [1]: 2

In [2]:
Do you really want to exit ([y]/n)? y
Shutting down kernel

(jupyter) C:\sw\julia>