Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter 7. #1490

Open
TyberiusPrime opened this issue Jan 9, 2024 · 0 comments
Open

Jupyter 7. #1490

TyberiusPrime opened this issue Jan 9, 2024 · 0 comments

Comments

@TyberiusPrime
Copy link
Contributor

Describe the issue

Set up a poetry with 'jupyter', nix develop, try running jupyter notebook.
(After application of #1488).

Expected: Notebook in browser.
Actually: incomplete page load,
Console message:

    Traceback (most recent call last):
      File "/nix/store/9rrmac81hs38vlbcsy17b2pvxg97hqrc-python3.11-tornado-6.4/lib/python3.11/site-packages/tornado/web.py", line 1788, in _execute
        result = method(*self.path_args, **self.path_kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/9rrmac81hs38vlbcsy17b2pvxg97hqrc-python3.11-tornado-6.4/lib/python3.11/site-packages/tornado/web.py", line 3301, in wrapper
        return method(self, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/w52wwipfhr991ahb0p94qnqh2khximjr-python3.11-jupyterlab-server-2.25.2/lib/python3.11/site-packages/jupyterlab_server/settings_handler.py", line 57, in get
        result, warnings = get_settings(
                           ^^^^^^^^^^^^^
      File "/nix/store/w52wwipfhr991ahb0p94qnqh2khximjr-python3.11-jupyterlab-server-2.25.2/lib/python3.11/site-packages/jupyterlab_server/settings_utils.py", line 379, in get_settings
        schema, version = _get_schema(schemas_dir, schema_name, overrides, labextensions_path)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/nix/store/w52wwipfhr991ahb0p94qnqh2khximjr-python3.11-jupyterlab-server-2.25.2/lib/python3.11/site-packages/jupyterlab_server/settings_utils.py", line 55, in _get_schema
        raise web.HTTPError(404, notfound_error % path)
    tornado.web.HTTPError: HTTP 404: Not Found (Schema not found: /nix/store/5k91mg4qjylxbfvrv748smfh51ppjq0g-python3-3.11.6/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json)

Additional context

NixOS/nixpkgs#255923
and NixOS/nixpkgs#268078

But attempting that fix, by calling JUPYTER_PATH=<nix-store-path-where-the-files-actually_are> jupyter notebook does not change the path it's using, it still complains about the same path below the python3 nix store path.

flake.nix:

{
  description = "Application packaged using poetry2nix";

  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    poetry2nix = {
      url = "github:TyberiusPrime/poetry2nix/rpds-py";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    self,
    nixpkgs,
    flake-utils,
    poetry2nix,
  }:
    flake-utils.lib.eachDefaultSystem (system: let
      # see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
      pkgs = nixpkgs.legacyPackages.${system};
      inherit (poetry2nix.lib.mkPoetry2Nix {inherit pkgs;}) mkPoetryApplication overrides;
    in {
      packages = {
        myapp = mkPoetryApplication {
          projectDir = self;
          overrides =
            overrides.withDefaults
            (
              self: super: {
              }
            );
        };
        default = self.packages.${system}.myapp;
      };

      devShells.default = pkgs.mkShell {
        inputsFrom = [self.packages.${system}.myapp];
        packages = [pkgs.poetry];
      };
    });
}

pyproject.toml:

[tool.poetry]
name = "jupyter-poetry2nix"
version = "0.1.0"
description = ""
authors = ["whatever"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
notebook = "^7.0.6"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
                                              

poetry.lock:

[too long]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant