I’m trying to install jupyter-book, and I’ve got as far as installing one of its dependencies, attrs. But when the builder runs it gives this error:
warning: Git tree '/home/jon/Code/book-computational-literary-analysis' is dirty
error: builder for '/nix/store/pp9074i7bmmvfmff4lkdmnj2wkj8vdaj-python3.8-attrs-20.3.0.drv' failed with exit code 1;
last 10 log lines:
> Executing pipInstallPhase
> /build/attrs-20.3.0/dist /build/attrs-20.3.0
> Processing ./attrs-20.3.0-py2.py3-none-any.whl
> Installing collected packages: attrs
> Attempting uninstall: attrs
> Found existing installation: attrs 21.2.0
> Uninstalling attrs-21.2.0:
> ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '_cmp.pyi'
> Consider using the `--user` option or check the permissions.
>
For full logs, run 'nix log /nix/store/pp9074i7bmmvfmff4lkdmnj2wkj8vdaj-python3.8-attrs-20.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/z9hkqa5qfvpqjjikv6m6fahfia37k07q-python3-3.8.9-env.drv' failed to build
What’s going on here, and how do I fix it? It looks like it’s attempting to uninstall another version of the package, which wouldn’t be possible with Nix. So how can I tell buildPythonPackage not to look for existing installs?
Any chance the attrs wheel just produces a write-only file that nix tries to patch for nix reasons? Maybe a postUnpackPhase with chmod +w some/file would do the trick.
How would one do that? I have no idea where to find the files that are produced mid-build. Or how to find a list of phases that the python builder is running. Or where to find documentation on that builder, and how it works.
Looks like you’re using flakes? The simplest way to debug during the build is just to plop down an ls -l in one of the phases and look at the output of nix build -L
For more proper debugging nix shellnix develop can enter the build env during specific phases.
Looks like you’re using flakes? The simplest way to debug during the build is just to plop down an ls -l in one of the phases and look at the output of nix build -L
Where exactly is “in one of the phases”?
I know where the nixpkgs manual is, but there isn’t any documentation there about the phases of the python builder. Nowhere do I see anything about pipInstallPhase, for instance, which is where this is failing.
I’d assumed you were looking for general documentation as you said you have “no idea”. I would suggest using text search on the nixpkgs repo occasionally when looking for implementation details of particular languages/frameworks, since those don’t always manage to bubble up to the public docs.
That said, I don’t think full knowledge of that is per-se necessary if you have nix develop and general knowledge of the build phases as defined in the stdenv.
Ok so I ran nix develop but I’m getting this error:
✦ ❯ nix develop
warning: Git tree '/home/jon/Code/book-computational-literary-analysis' is dirty
error: builder for '/nix/store/pp9074i7bmmvfmff4lkdmnj2wkj8vdaj-python3.8-attrs-20.3.0.drv' failed with exit code 1;
last 10 log lines:
> Executing pipInstallPhase
> /build/attrs-20.3.0/dist /build/attrs-20.3.0
> Processing ./attrs-20.3.0-py2.py3-none-any.whl
> Installing collected packages: attrs
> Attempting uninstall: attrs
> Found existing installation: attrs 21.2.0
> Uninstalling attrs-21.2.0:
> ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '_cmp.pyi'
> Consider using the `--user` option or check the permissions.
>
For full logs, run 'nix log /nix/store/pp9074i7bmmvfmff4lkdmnj2wkj8vdaj-python3.8-attrs-20.3.0.drv'.
error: 1 dependencies of derivation '/nix/store/3j9b3518z3ggfpq09k3552wr3hq9qpjl-python3-3.8.9-env-env.drv' failed to build