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

[Bug]: Python kernel with matplotlib fails to nix evaluate #395

Closed
MMesch opened this issue Dec 19, 2022 · 2 comments
Closed

[Bug]: Python kernel with matplotlib fails to nix evaluate #395

MMesch opened this issue Dec 19, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MMesch
Copy link
Contributor

MMesch commented Dec 19, 2022

Current Behavior

jupyterWith fails to build the Python kernel when matplotlib is added as extraPackage.

Expected Behavior

Should work since this is one of the most common Python packages out there.

Steps To Reproduce

Copy the template:

nix flake init -t github:tweag/jupyterWith

Then change the python kernel to:

{
  name,
  availableKernels,
  extraArgs,
}:
availableKernels.python {
  name = "custom-${name}";
  inherit (extraArgs) system;
  displayName = "Custom ${name}";
  extraPackages = ps: [ ps.matplotlib ];
}

On my machine this produces:

warning: Using saved setting for 'extra-substituters = https://tweag-jupyter.cachix.org' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = tweag-jupyter.cachix.org-1:UtNH4Zs6hVUFpFBTLaA4ejYavPo5EFFqgd7G7FxGW9g=' from ~/.local/share/nix/trusted-settings.json.
error: attribute 'format' missing

       at /nix/store/4myxpy1b0lipw5mcrvvghj99n1b89a49-source/overrides/default.nix:1499:40:

         1498|             ++ lib.optionals (self.isPyPy) [ tk xorg.libX11 ];
         1499|           preConfigure = lib.optional (old.format != "wheel") preConfigure;
             |                                        ^
         1500|         }
(use '--show-trace' to show detailed location information)

OS

nixos build with flakes

Version

flake.lock is attached below

Additional Context

{
  "nodes": {
    "flake-compat": {
      "flake": false,
      "locked": {
        "lastModified": 1668681692,
        "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "009399224d5e398d03b22badca40a37ac85412a1",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-compat_2": {
      "flake": false,
      "locked": {
        "lastModified": 1668681692,
        "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "009399224d5e398d03b22badca40a37ac85412a1",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-compat_3": {
      "flake": false,
      "locked": {
        "lastModified": 1627913399,
        "narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-compat_4": {
      "flake": false,
      "locked": {
        "lastModified": 1668681692,
        "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
        "owner": "edolstra",
        "repo": "flake-compat",
        "rev": "009399224d5e398d03b22badca40a37ac85412a1",
        "type": "github"
      },
      "original": {
        "owner": "edolstra",
        "repo": "flake-compat",
        "type": "github"
      }
    },
    "flake-utils": {
      "locked": {
        "lastModified": 1667395993,
        "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "flake-utils_2": {
      "locked": {
        "lastModified": 1667395993,
        "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "flake-utils_3": {
      "locked": {
        "lastModified": 1629481132,
        "narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "997f7efcb746a9c140ce1f13c72263189225f482",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "gitignore": {
      "flake": false,
      "locked": {
        "lastModified": 1611672876,
        "narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=",
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "rev": "211907489e9f198594c0eb0ca9256a1949c9d412",
        "type": "github"
      },
      "original": {
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "type": "github"
      }
    },
    "gitignore_2": {
      "inputs": {
        "nixpkgs": [
          "jupyterWith",
          "pre-commit-hooks",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1660459072,
        "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
        "type": "github"
      },
      "original": {
        "owner": "hercules-ci",
        "repo": "gitignore.nix",
        "type": "github"
      }
    },
    "hls": {
      "inputs": {
        "flake-compat": "flake-compat_3",
        "flake-utils": "flake-utils_3",
        "gitignore": "gitignore",
        "nixpkgs": "nixpkgs",
        "pre-commit-hooks": "pre-commit-hooks"
      },
      "locked": {
        "lastModified": 1637213318,
        "narHash": "sha256-ZgxPwV7t4DyGYP7aXoetq+JHtd73XlOV2fYSflQmOXw=",
        "owner": "haskell",
        "repo": "haskell-language-server",
        "rev": "311107eabbf0537e0c192b2c377d282505b4eff1",
        "type": "github"
      },
      "original": {
        "owner": "haskell",
        "repo": "haskell-language-server",
        "type": "github"
      }
    },
    "ihaskell": {
      "inputs": {
        "flake-compat": [
          "jupyterWith",
          "flake-compat"
        ],
        "flake-utils": [
          "jupyterWith",
          "flake-utils"
        ],
        "hls": "hls",
        "nixpkgs": [
          "jupyterWith",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1668371230,
        "narHash": "sha256-yGqXQj+swFEgOFa2CJn9oW/syFuMzZF9pyDQfxOYgT4=",
        "owner": "ihaskell",
        "repo": "ihaskell",
        "rev": "465fded2f705cedbc791d210508ca9febc04a208",
        "type": "github"
      },
      "original": {
        "owner": "ihaskell",
        "repo": "ihaskell",
        "type": "github"
      }
    },
    "jupyterWith": {
      "inputs": {
        "flake-compat": "flake-compat_2",
        "flake-utils": "flake-utils_2",
        "ihaskell": "ihaskell",
        "nixpkgs": "nixpkgs_2",
        "nixpkgs-stable": "nixpkgs-stable",
        "npmlock2nix": "npmlock2nix",
        "opam-nix": "opam-nix",
        "poetry2nix": "poetry2nix",
        "pre-commit-hooks": "pre-commit-hooks_2",
        "rust-overlay": "rust-overlay"
      },
      "locked": {
        "lastModified": 1670546271,
        "narHash": "sha256-h+qEvQS+elTt7xfPjktjfbuTcQiBh1M0P5F3+osxpFs=",
        "owner": "tweag",
        "repo": "jupyterWith",
        "rev": "778ec10b5ed23153b4552418e85fdba9321d59cc",
        "type": "github"
      },
      "original": {
        "owner": "tweag",
        "repo": "jupyterWith",
        "type": "github"
      }
    },
    "mirage-opam-overlays": {
      "flake": false,
      "locked": {
        "lastModified": 1661959605,
        "narHash": "sha256-CPTuhYML3F4J58flfp3ZbMNhkRkVFKmBEYBZY5tnQwA=",
        "owner": "dune-universe",
        "repo": "mirage-opam-overlays",
        "rev": "05f1c1823d891ce4d8adab91f5db3ac51d86dc0b",
        "type": "github"
      },
      "original": {
        "owner": "dune-universe",
        "repo": "mirage-opam-overlays",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1630887066,
        "narHash": "sha256-0ecIlrLsNIIa+zrNmzXXmbMBLZlmHU/aWFsa4bq99Hk=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "5e47a07e9f2d7ed999f2c7943b0896f5f7321ca3",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixpkgs-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-stable": {
      "locked": {
        "lastModified": 1669546925,
        "narHash": "sha256-Gvtk9agz88tBgqmCdHl5U7gYttTkiuEd8/Rq1Im0pTg=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "fecf05d4861f3985e8dee73f08bc82668ef75125",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixos-22.05",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs-stable_2": {
      "locked": {
        "lastModified": 1668984258,
        "narHash": "sha256-0gDMJ2T3qf58xgcSbYoXiRGUkPWmKyr5C3vcathWhKs=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "cf63ade6f74bbc9d2a017290f1b2e33e8fbfa70a",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-22.05",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs_2": {
      "locked": {
        "lastModified": 1669542132,
        "narHash": "sha256-DRlg++NJAwPh8io3ExBJdNW7Djs3plVI5jgYQ+iXAZQ=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "a115bb9bd56831941be3776c8a94005867f316a7",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "nixpkgs_3": {
      "locked": {
        "lastModified": 1671359686,
        "narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=",
        "owner": "nixos",
        "repo": "nixpkgs",
        "rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4",
        "type": "github"
      },
      "original": {
        "owner": "nixos",
        "ref": "nixos-unstable",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "npmlock2nix": {
      "flake": false,
      "locked": {
        "lastModified": 1668989938,
        "narHash": "sha256-/IxdS0AiqSN0/VEOLnnfHyi4nP17yPrkhGf6KlXVwrc=",
        "owner": "nix-community",
        "repo": "npmlock2nix",
        "rev": "0ba0746d62974403daf717cded3f24c617622bc7",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "npmlock2nix",
        "type": "github"
      }
    },
    "opam-nix": {
      "inputs": {
        "flake-compat": [
          "jupyterWith",
          "flake-compat"
        ],
        "flake-utils": [
          "jupyterWith",
          "flake-utils"
        ],
        "mirage-opam-overlays": "mirage-opam-overlays",
        "nixpkgs": [
          "jupyterWith",
          "nixpkgs"
        ],
        "opam-overlays": "opam-overlays",
        "opam-repository": "opam-repository",
        "opam2json": "opam2json"
      },
      "locked": {
        "lastModified": 1669980144,
        "narHash": "sha256-1z9Lza41Ii30/Ljdeozoz7okm0+X+QyHilGjChzrZHo=",
        "owner": "tweag",
        "repo": "opam-nix",
        "rev": "a89f779c5b248c06136143e139848acae5d0ea49",
        "type": "github"
      },
      "original": {
        "owner": "tweag",
        "ref": "fix-list-repo-func",
        "repo": "opam-nix",
        "type": "github"
      }
    },
    "opam-overlays": {
      "flake": false,
      "locked": {
        "lastModified": 1654162756,
        "narHash": "sha256-RV68fUK+O3zTx61iiHIoS0LvIk0E4voMp+0SwRg6G6c=",
        "owner": "dune-universe",
        "repo": "opam-overlays",
        "rev": "c8f6ef0fc5272f254df4a971a47de7848cc1c8a4",
        "type": "github"
      },
      "original": {
        "owner": "dune-universe",
        "repo": "opam-overlays",
        "type": "github"
      }
    },
    "opam-repository": {
      "flake": false,
      "locked": {
        "lastModified": 1661161626,
        "narHash": "sha256-J3P+mXLwE2oEKTlMnx8sYRxwD/uNGSKM0AkAB7BNTxA=",
        "owner": "ocaml",
        "repo": "opam-repository",
        "rev": "54e69ff0949a3aaec0d5e3d67898bb7f279ab09f",
        "type": "github"
      },
      "original": {
        "owner": "ocaml",
        "repo": "opam-repository",
        "type": "github"
      }
    },
    "opam2json": {
      "inputs": {
        "nixpkgs": [
          "jupyterWith",
          "opam-nix",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1665671715,
        "narHash": "sha256-7f75C6fIkiLzfkwLpJxlQIKf+YORGsXGV8Dr2LDDi+A=",
        "owner": "tweag",
        "repo": "opam2json",
        "rev": "32fa2dcd993a27f9e75ee46fb8b78a7cd5d05113",
        "type": "github"
      },
      "original": {
        "owner": "tweag",
        "repo": "opam2json",
        "type": "github"
      }
    },
    "poetry2nix": {
      "inputs": {
        "flake-utils": [
          "jupyterWith",
          "flake-utils"
        ],
        "nixpkgs": [
          "jupyterWith",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1669635649,
        "narHash": "sha256-jGu5WoQrFLQBqT1BrwUtFsktzGkNoq9r6w6jwJdCpB8=",
        "owner": "nix-community",
        "repo": "poetry2nix",
        "rev": "ce8425ccc2884c1065927a38d1700024f431cf0f",
        "type": "github"
      },
      "original": {
        "owner": "nix-community",
        "repo": "poetry2nix",
        "type": "github"
      }
    },
    "pre-commit-hooks": {
      "inputs": {
        "flake-utils": [
          "jupyterWith",
          "ihaskell",
          "hls",
          "flake-utils"
        ],
        "nixpkgs": [
          "jupyterWith",
          "ihaskell",
          "hls",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1624971177,
        "narHash": "sha256-Amf/nBj1E77RmbSSmV+hg6YOpR+rddCbbVgo5C7BS0I=",
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "rev": "397f0713d007250a2c7a745e555fa16c5dc8cadb",
        "type": "github"
      },
      "original": {
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "type": "github"
      }
    },
    "pre-commit-hooks_2": {
      "inputs": {
        "flake-compat": "flake-compat_4",
        "flake-utils": [
          "jupyterWith",
          "flake-utils"
        ],
        "gitignore": "gitignore_2",
        "nixpkgs": [
          "jupyterWith",
          "nixpkgs"
        ],
        "nixpkgs-stable": "nixpkgs-stable_2"
      },
      "locked": {
        "lastModified": 1669152228,
        "narHash": "sha256-FEDReoTLWJHXcNso7aaAlAUU7uOqIR6Hc/C/nqlfooE=",
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "rev": "078b0dee35e2da01334af682ec347463b70a9986",
        "type": "github"
      },
      "original": {
        "owner": "cachix",
        "repo": "pre-commit-hooks.nix",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "flake-compat": "flake-compat",
        "flake-utils": "flake-utils",
        "jupyterWith": "jupyterWith",
        "nixpkgs": "nixpkgs_3"
      }
    },
    "rust-overlay": {
      "inputs": {
        "flake-utils": [
          "jupyterWith",
          "flake-utils"
        ],
        "nixpkgs": [
          "jupyterWith",
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1669602829,
        "narHash": "sha256-I3LBvBiVui4Rf0iQvTqUIgBovaLDzpOzsoNEzCsDowg=",
        "owner": "oxalica",
        "repo": "rust-overlay",
        "rev": "b9da8e68a08707115be750c0cf7ade33f49d8ec4",
        "type": "github"
      },
      "original": {
        "owner": "oxalica",
        "repo": "rust-overlay",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Relevant log output

No response

@MMesch MMesch added the bug Something isn't working label Dec 19, 2022
@GTrunSec
Copy link
Collaborator

GTrunSec commented Dec 23, 2022

It can be determined that the problem is caused by poetry. #361

@djacu
Copy link
Contributor

djacu commented Jan 20, 2023

This should be fixed with #415.
A new example kernel was added to the CI that pulls in numpy, scipy, and matplotlib via extraPackages. All seems to be working now.

@djacu djacu closed this as completed Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants