NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.11k stars 14.15k forks source link

jupyter notebook package is broken and service does not work #355046

Open JohnRTitor opened 2 days ago

JohnRTitor commented 2 days ago

Describe the bug

I believe Jupyter notebook package has some stuff missing due to a packaging oversight, this makes the package unusable.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Enable the service and open localhost:8888 or whatever you configured
  2. Login and see an empty screen without anything to do

Expected behavior

Jupyter notebook works properly.

Screenshots

image

Additional context

Log from systemctl status jupyter.service:

Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:       File "/nix/store/gnvanwhk2v293gcp4a75sf294giym0ms-python3.12-jupyterlab-server-2.27.3/lib/python3.12/site-packages/jupyterlab_server/settings_handler.py", line 58, in get
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:         result, warnings = get_settings(
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:                            ^^^^^^^^^^^^^
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:       File "/nix/store/gnvanwhk2v293gcp4a75sf294giym0ms-python3.12-jupyterlab-server-2.27.3/lib/python3.12/site-packages/jupyterlab_server/settings_utils.py", line 385, in get_settings
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:         schema, version = _get_schema(schemas_dir, schema_name, overrides, labextensions_path)
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:       File "/nix/store/gnvanwhk2v293gcp4a75sf294giym0ms-python3.12-jupyterlab-server-2.27.3/lib/python3.12/site-packages/jupyterlab_server/settings_utils.py", line 61, in _get_schema
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:         raise web.HTTPError(404, notfound_error % path)
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]:     tornado.web.HTTPError: HTTP 404: Not Found (Schema not found: /nix/store/901c80rlps5q05bnjk1sj4zaz5k736nc-python3-3.12.7/share/jupyter/lab/schemas/@jupyterlab/notebook-extension/panel.json)
Nov 11 00:32:24 Ainz-NIX jupyter-notebook[1460]: [W 2024-11-11 00:32:24.080 JupyterNotebookApp] 404 GET /lab/api/settings/@jupyterlab/notebook-extension:panel?1731265344066 (926d58aeacc84c59b2ee947204997e6d@::1) 2.49ms referer=http://localhost:8888/tree

It also fails when launching from the terminal.

Notify maintainers

@GaetanLepage @natsukium @thomasjm

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.6-cachyos, NixOS, 24.11 (Vicuna), 24.11.20241109.76612b1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Lix, like Nix) 2.91.1
System type: x86_64-linux
Additional system types: aarch64-linux, i686-linux
Features: gc, signed-caches
System configuration file: /etc/nix/nix.conf
User configuration files: /home/masum/.config/nix/nix.conf:/etc/xdg/nix/nix.conf:/home/masum/.local/share/flatpak/exports/etc/xdg/nix/nix.conf:/var/lib/flatpak/exports/etc/xdg/nix/nix.conf:/home/masum/.nix-profile/etc/xdg/nix/nix.conf:/home/masum/.local/state/nix/profile/etc/xdg/nix/nix.conf:/home/masum/.local/state/nix/profile/etc/xdg/nix/nix.conf:/etc/profiles/per-user/masum/etc/xdg/nix/nix.conf:/nix/var/nix/profiles/default/etc/xdg/nix/nix.conf:/run/current-system/sw/etc/xdg/nix/nix.conf
Store directory: /nix/store
State directory: /nix/var/nix
Data directory: /nix/store/k1iys4jifr01ql4bzafl6ny71qzw32wz-lix-2.91.1/share`
 - nixpkgs: `/nix/store/0sxsfzswhjck7f4sbsvznz285s4i7y64-source`

Add a :+1: reaction to issues you find important.

JohnRTitor commented 2 days ago

I would try to fix this myself but I have no idea about python packaging :(

Pinging @dotlambda @fabaff for their inputs as well.

natsukium commented 2 days ago

Is this the case when enabled via nixos modules? It works fine with nix-shell on master branch in my environment, but do you get the same error?

nix-shell -p 'python3.withPackages (ps: with ps; [jupyter])' --run 'jupyter notebook'
JohnRTitor commented 1 day ago

Thanks for the prompt response, the above nix-shell command works.

Is this the case when enabled via nixos modules?

Yes. I am using the following as my starter setup. Will configure it more if this issue is fixed.

{pkgs, ...}:
{
  services.jupyter.enable = true;
  services.jupyter.password = "'sha1:1b961dc713fb:88483270a63e57d18d43cf337e629539de1436ba'"; # test
  #services.jupyter.notebookDir = "Notebooks";
}

image

Left: Nix-shell Right: Service