mach-nix icon indicating copy to clipboard operation
mach-nix copied to clipboard

Impossible to install jupyter: collisions

Open tobiasBora opened this issue 3 years ago • 4 comments

If I install:

let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix";
    ref = "refs/tags/3.4.0";
  }) {};
in
mach-nix.mkPythonShell {
  requirements = ''
    numpy
    pyzx
    jupyter
  '';
}

I get an error involving collisions between jupyter and jupyter-core:

$ nix-shell
[...]
Executing pythonImportsCheckPhase
building '/nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv'...
error: collision between `/nix/store/hi7fmaw2mpd40n7k0iwbvb8jya5h68gx-python3.9-jupyter-core-4.9.1/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc' and `/nix/store/n1ryapkfd3h8zddsa1iqf6icdjv8lbvb-python3.9-jupyter-1.0.0/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc'
error: builder for '/nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/hi7fmaw2mpd40n7k0iwbvb8jya5h68gx-python3.9-jupyter-core-4.9.1/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc' and `/nix/store/n1ryapkfd3h8zddsa1iqf6icdjv8lbvb-python3.9-jupyter-1.0.0/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc'
       For full logs, run 'nix log /nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv'.
error: 1 dependencies of derivation '/nix/store/7g5szv60g329j12m1fpn8sihw8qspnh8-python3-3.9.9-env.drv' failed to build

tobiasBora avatar May 20 '22 21:05 tobiasBora

Note that the ignoreCollisions seems to fail:

$ cat shell.nix 
let
  mach-nix = import (builtins.fetchGit {
    url = "https://github.com/DavHau/mach-nix";
    ref = "refs/tags/3.4.0";
  }) {};
in
mach-nix.mkPythonShell {
  requirements = ''
    numpy
    pyzx
    jupyter
  '';
  ignoreCollisions = true;
}

$ nix-shell
these 2 derivations will be built:
  /nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv
  /nix/store/slhnw3s3lmlbxzllbd8yvarn3s7ag6qm-python3-3.9.9-env.drv
building '/nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv'...
error: collision between `/nix/store/hi7fmaw2mpd40n7k0iwbvb8jya5h68gx-python3.9-jupyter-core-4.9.1/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc' and `/nix/store/n1ryapkfd3h8zddsa1iqf6icdjv8lbvb-python3.9-jupyter-1.0.0/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc'
error: builder for '/nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv' failed with exit code 25;
       last 1 log lines:
       > error: collision between `/nix/store/hi7fmaw2mpd40n7k0iwbvb8jya5h68gx-python3.9-jupyter-core-4.9.1/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc' and `/nix/store/n1ryapkfd3h8zddsa1iqf6icdjv8lbvb-python3.9-jupyter-1.0.0/lib/python3.9/site-packages/__pycache__/jupyter.cpython-39.pyc'
       For full logs, run 'nix log /nix/store/brd35m2xw09fqisqlnxkg2c8gigqwz32-python3-3.9.9-env.drv'.
error: 1 dependencies of derivation '/nix/store/slhnw3s3lmlbxzllbd8yvarn3s7ag6qm-python3-3.9.9-env.drv' failed to build

tobiasBora avatar May 20 '22 21:05 tobiasBora

I found this too - https://jupyter.org/install actually recommends installing via pip install notebook instead of pip install jupyter: using notebook fixed it for me.

charlesbaynham avatar May 28 '22 10:05 charlesbaynham

or tell mach-nix to remove the duplicate files:

  _."jupyter-core".postInstall = ''
              rm $out/lib/python*/site-packages/jupyter.py
              rm $out/lib/python*/site-packages/__pycache__/jupyter.cpython*.pyc
            '';

TyberiusPrime avatar Jul 12 '22 08:07 TyberiusPrime

same for jupyterlab

quinn-dougherty avatar Sep 14 '22 02:09 quinn-dougherty