Error: nose-1.3.7 not supported for interpreter python3.12

What I did: sudo nixos-rebuild switch --upgrade on my desktop computer. I have been regularly running this command about once a day for months, now, and I ran it last night, so this is a recent problem.

What I expected to happen: My computer would update to the latest version of nixpkgs.

What happened: I received an error which prevented the update:

“error: nose-1.3.7 not supported for interpreter python3.12”

Some context: python3.12 is not currently installed on my system. I put “python3Full” in my configuration.nix file, but it seems that it may have been pointing to python3.11 up until now, because nix-store -qR /run/current-system | grep python doesn’t show anything with a “python3.12” name, only things named “python3.11”. I’m running the latest linux kernel, and I’m on GNOME, with a bunch of other applications installed. I’m not using home manager or flakes.

Some things I tried to fix it: Removing python3Full from my configuration.nix . This didn’t help at all. Switching to python3 instead of python3Full. This also didn’t help. I only have the one line in my configuration.nix which mentions Python, and it is its entry in the “users.users.myusername.packages” list.

3 Likes

I’m stuck on the exact same thing. For me I came here right after solving a similar issue with sip which is discussed here: Issue building NixOS due to sip package

Here is a relevant github issue I found.

2 Likes

I uninstalled “asciinema” from my computer - that fixed the problem. It seems that the nixpkgs maintainers of that package use nose in the “checkPhase” of that package.

1 Like

Thanks for the link. The mention of asciinema in the Build failure: Spotdl issue is what lead to me solving the problem for myself. I have not figured out any particularly convenient and general way of finding problems of this kind, though. One thing that I might try in your situation, if I were to give up on asking other people and given up on finding an approach that I thought was easy, would be running nix-store -q --referrers on your base python3 packages, and then checking the .nix files responsible for building it in the pkgs directory of nixpkgs for mention of nose in the checkPhase. But you can likely find an easier and more intelligent approach than that - I’m not an expert, and you might be able to find one or be one.

3 Likes

Hello, same thing… what the easiest way to fix this for now?


       … while evaluating derivation 'keyd-application-mapper-2.4.3'
         whose name attribute is located at /nix/store/yzkx7gx2cn73dh3c7zg5rvgkp3yli1cd-source/pkgs/stdenv/generic/make-derivation.nix:332:7

       … while evaluating attribute 'propagatedBuildInputs' of derivation 'keyd-application-mapper-2.4.3'

         at /nix/store/yzkx7gx2cn73dh3c7zg5rvgkp3yli1cd-source/pkgs/stdenv/generic/make-derivation.nix:386:7:

          385|       depsHostHostPropagated      = elemAt (elemAt propagatedDependencies 1) 0;
          386|       propagatedBuildInputs       = elemAt (elemAt propagatedDependencies 1) 1;
             |       ^
          387|       depsTargetTargetPropagated  = elemAt (elemAt propagatedDependencies 2) 0;

       … while evaluating derivation 'python3.12-xlib-0.33'
         whose name attribute is located at /nix/store/yzkx7gx2cn73dh3c7zg5rvgkp3yli1cd-source/pkgs/stdenv/generic/make-derivation.nix:332:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'python3.12-xlib-0.33'

         at /nix/store/yzkx7gx2cn73dh3c7zg5rvgkp3yli1cd-source/pkgs/stdenv/generic/make-derivation.nix:376:7:

          375|       depsBuildBuild              = elemAt (elemAt dependencies 0) 0;
          376|       nativeBuildInputs           = elemAt (elemAt dependencies 0) 1;
             |       ^
          377|       depsBuildTarget             = elemAt (elemAt dependencies 0) 2;

       error: nose-1.3.7 not supported for interpreter python3.12
1 Like

You could remove keyd from your config.

This issue also occurs with solaar which is brought in by having hardware.logitech.wireless.enable.

So my wireless mouse will stop working if I disable this.

I guess I need to disable the test for solaar or replace nose with pynose like this:

It’s not merged yet, but pynose may not be in nixpkgs for long because of license issues:

xlib is fixed by python312Packages.xlib: don't use nose by dotlambda · Pull Request #325872 · NixOS/nixpkgs · GitHub

2 Likes

I see many of these fixes are setting doCheck to false. However solaar fails despite doCheck already being false?

nix-repl> pkgs = import  (fetchTarball "https://github.com/nixos/nixpkgs/archive/655a58a72a6601292512670343087c2d75d859c1.tar.gz") {}

nix-repl> pkgs.solaar.doCheck
false

nix-repl> :b pkgs.solaar
error:
       … while evaluating the attribute 'drvPath'

         at /nix/store/yzkx7gx2cn73dh3c7zg5rvgkp3yli1cd-source/lib/customisation.nix:365:7:

          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |       ^
          366|       outPath = assert condition; drv.outPath;

       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: nose-1.3.7 not supported for interpreter python3.12

Can I somehow remove nose using overridePythonAttrs or an overlay? I re-reviewed Nixpkgs Reference Manual and looked over nixpkgs/pkgs/applications/misc/solaar/default.nix at 655a58a72a6601292512670343087c2d75d859c1 · NixOS/nixpkgs · GitHub

I’m confused though since there is no mention of nose that I can remove.

Solaar depends on xlib, which does depend on nose.

I am removing pynose in python312Packages.pynose: drop due to licensing issues by mweinelt · Pull Request #325669 · NixOS/nixpkgs · GitHub due to its license violating the license of nose itself.

The recommendation for those packages is

  • Check whether the tests can be migrated to another test-runner (e.g. pytest)
  • File an issue upstream to make them aware, that nose does not work with Python 3.12
  • Set doCheck = pythonOlder "3.12" for affected packages

Regrettably, I don’t have time to learn more about python packaging in Nix to be able to pursue the recommended options.

I’ve resolved my issue with the doCheck = false; hammer in an overlay:

final: prev: {
    python = prev.python3.override {
      packageOverrides = prev: final: {
        xlib =  final.xlib.overridePythonAttrs (old: { doCheck = false; });
      };
    };
}

Though truthfully even this quick and dirty method took an hour to track down the error and find a fix that lets me update my machine.

A fix for xlib was merged just minutes ago in python312Packages.xlib: don't use nose by dotlambda · Pull Request #325872 · NixOS/nixpkgs · GitHub

1 Like

For anyone else that comes across this issue: I think the easiest way to fix this is probably just to rollback your flake.lock file (if you have one) to a working version. If you’re using git that should be as easy as git restore flake.lock which will revert it to the version from your last commit, without rolling anything else back.

Workaround for jellyfin-mpv-shim if you don’t need the system tray functionality (which depends on python xlib which depends on nose):

(pkgs.jellyfin-mpv-shim.overrideAttrs (finalAttrs: previousAttrs: {
    propagatedBuildInputs = with python3Packages; [
      jellyfin-apiclient-python
      mpv
      pillow
      python-mpv-jsonipc
      #pystray
      #tkinter
      jinja2
      pywebview
    ];
  }))

The program will just fallback to the CLI version if the GUI dependencies aren’t supplied.

See also: python312Packages.nose: fix, use pep517 builder by jchv · Pull Request #325935 · NixOS/nixpkgs · GitHub

nixpkgs.overlays = [
    (_: prev: {
        python312 = prev.python312.override { packageOverrides = _: pysuper: { nose = pysuper.pynose; }; };
    })
];

Sledgehammer for all 3.12 packages using nose.

4 Likes

(nvidia) gwe python3.12-xlib-0.33

doen’t works e.g. for

  • gtg-0.6
  • diffoscope
nativeCheckInputs = with python3Packages; [
    nose