-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
pipenv broken on nixos-19.09 #73254
Comments
cc @jonringer @FRidh |
I think this was fixed on master, I'll try to find the PR |
try doing `nix-shell --pure --run 'unset PYTHONPATH; pipenv install requests' |
im going to defer to @FRidh on this one, as he's more familiar with pipenv + nixpkgs |
Yes, it is fixed on master, the PRs that fixed it are linked in the issue body above. |
Fantastic, this does in fact solve the problem! So the fix is:
|
I've backported the commits to 19.09 just now. Typically you should use |
Fantastic, thanks!
I used |
|
I've confirmed the backports work for me by pointing the URL to the most recent commit in https://github.com/NixOS/nixpkgs/commits/release-19.09: - url = https://github.com/nixos/nixpkgs/archive/2d896998dc9b1b0daeb8a180dc170733f1225678.tar.gz;
- sha256 = "1vj3bwljkh55si4qjx52zgw7nfy6mnf324xf1l2i5qffxlh7qxb6";
+ url = https://github.com/nixos/nixpkgs/archive/465e405dc9eda8d5f2b88af9e4555fcb4bfc1874.tar.gz;
+ sha256 = "096crqig0srjq8q6z7655yb46jmjj4zvjn0x1brwls7ibg8vv3gc"; Would it make sense to have a test that would try to run |
How would we run such a test? If you want to run it in a |
Unfortunately that can't really be done in a sandbox environment. Would need to prefetch the dependencies like @FRidh states. You could have a testScript which does the installation steps. But you would need to mention it in the expression, and it would have to be ran manually, not as part of the build. Not particularly elegant, but it's more than nothing. |
Ah, of course, and the sandbox does not have network access either, so yes, installing What could potentially work is installing Yet another option is to ship a dummy python package with the |
This is to prevent regressions such as #73254 by using pipenv to install a simple Python package, thus testing that pipenv was built correctly. Many thanks to @infinisil and @domenkozar for hand-holding!
I've tried the process from the body of this issue, against latest $ cd /tmp && mkdir test && cd test
$ cat shell.nix
{ pkgs ? import (builtins.fetchTarball {
url = https://github.com/nixos/nixpkgs/archive/08e503bac6decf9a3e01b79ab1f9788bf76380b1.tar.gz;
sha256 = "1xf26fd1ahmz1m3si431xx8q8fs4xkbs6h4cznndgrr3hlafdgvg";
}) {}
}:
pkgs.mkShell {
name = "dev-shell";
buildInputs = [ pkgs.python37Full pkgs.pipenv];
} $ nix-shell --pure
[nix-shell:/private/tmp/test]$ pipenv install wheel
Creating a Pipfile for this project…
Installing wheel…
Adding wheel to Pipfile's [packages]…
✔ Installation Succeeded
Pipfile.lock not found, creating…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✔ Success!
Updated Pipfile.lock (fcf4b1)!
Installing dependencies from Pipfile.lock (fcf4b1)…
An error occurred while installing wheel==0.33.6 --hash=sha256:10c9da68765315ed98850f8e048347c3eb06dd81822dc2ab1d4fde9dc9702646 --hash=sha256:f4da1763d3becf2e2cd92a14a7c920f0f00eca30fdde9ea992c836685b9faf28! Will try again.
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 1/1 — 00:00:00
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]: File "/nix/store/czrwm7f44cbivraj0z2ccr06ll5iliyw-pipenv-2018.11.26/lib/python3.7/site-packages/pipenv/core.py", line 1992, in do_install
[pipenv.exceptions.InstallError]: skip_lock=skip_lock,
[pipenv.exceptions.InstallError]: File "/nix/store/czrwm7f44cbivraj0z2ccr06ll5iliyw-pipenv-2018.11.26/lib/python3.7/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]: pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]: File "/nix/store/czrwm7f44cbivraj0z2ccr06ll5iliyw-pipenv-2018.11.26/lib/python3.7/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]: retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]: File "/nix/store/czrwm7f44cbivraj0z2ccr06ll5iliyw-pipenv-2018.11.26/lib/python3.7/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]: _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]: File "/nix/store/czrwm7f44cbivraj0z2ccr06ll5iliyw-pipenv-2018.11.26/lib/python3.7/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]: raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: []
[pipenv.exceptions.InstallError]: ['Traceback (most recent call last):', ' File "/Users/zupo/.local/share/virtualenvs/test-6C_DLGjE/bin/pip", line 6, in <module>', ' from pip._internal.main import main', "ModuleNotFoundError: No module named 'pip._internal.main'"]
ERROR: ERROR: Package installation failed...
☤ ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:00 What am I doing wrong? |
Same as before, doing the same, but taking the last commit on - url = https://github.com/nixos/nixpkgs/archive/08e503bac6decf9a3e01b79ab1f9788bf76380b1.tar.gz;
- sha256 = "1xf26fd1ahmz1m3si431xx8q8fs4xkbs6h4cznndgrr3hlafdgvg";
+ url = https://github.com/nixos/nixpkgs/archive/0af613569c9056b2fa1c95b4a99dcb41219bb6dd.tar.gz;
+ sha256 = "07g3mlh0vfbz24v1dqwa0b72wkqky5zjp5yvbmy5cflirz12izzs";
|
unfortuantely this just means that it's picking up pip from the environment:
Although, this should have been fixed through backports, re-opening as this is still an issue on release-19.09 |
|
@FRidh: I'm using https://direnv.net/ with |
I think direnv's use_nix probably uses nix-shell. So you might not be able to use direnv. |
@zimbatm: sorry to drag you into this, but I wonder if you have any advice for how to use direnv without nix-shell, or if that wouldn't make sense at all? |
Describe the bug
I'm trying to
pipenv install requests
in a nix shell, but pipenv fails withModuleNotFoundError: No module named 'pip._internal.main'
.To Reproduce
Steps to reproduce the behavior:
shell.nix
, pointing to the most recent commit innixos-19.09
branch:nix-shell --pure --run 'pipenv install requests'
Expected behavior
If, in my
shell.nix
, I use the latest commit frommaster
branch, then pipenv works as expected:Additional context
MacOS Mojave, nix 2.3.1.
I found the following two PRs on master that touch
pkgs/development/tools/pipenv/default.nix
:I tried cherry-picking them on top of
nixos-19.09
andrelease-19.09
, butpipenv install requests
still fails:The text was updated successfully, but these errors were encountered: