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

Wheel python package unpack failed using fetchPypi #43468

Closed
ghost opened this issue Jul 13, 2018 · 3 comments
Closed

Wheel python package unpack failed using fetchPypi #43468

ghost opened this issue Jul 13, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 13, 2018

Issue description

I am trying to build python36 interpreter with numpy package. And i want to fetch and install numpy as python wheel package. As far as I understand, fetchPypi provides ability to fetch wheel, but everything it does is the change of URL. Nevertheless unpacking stage happens as It would be a zip/tar archive.
Error while building:

trying https://files.pythonhosted.org/packages/cp36/n/numpy/numpy-1.13.1-cp36-cp36m-manylinux1_x86_64.whl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 16.1M  100 16.1M    0     0  6337k      0  0:00:02  0:00:02 --:--:-- 9390k
building '/nix/store/g8lg6qdv56bb5z9q4wykfglk28a966xi-python3.6-numpy-1.13.1.drv'...
unpacking sources
unpacking source archive /nix/store/jij8z6r5bf0a5dwfw07v0rgmbhkgfl7k-numpy-1.13.1-cp36-cp36m-manylinux1_x86_64.whl
do not know how to unpack source archive /nix/store/jij8z6r5bf0a5dwfw07v0rgmbhkgfl7k-numpy-1.13.1-cp36-cp36m-manylinux1_x86_64.whl
builder for '/nix/store/g8lg6qdv56bb5z9q4wykfglk28a966xi-python3.6-numpy-1.13.1.drv' failed with exit code 1
cannot build derivation '/nix/store/6wc945dnw78lq2fp89p1v4j1fqbvyn5c-python3-3.6.5-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/6wc945dnw78lq2fp89p1v4j1fqbvyn5c-python3-3.6.5-env.drv' failed

Steps to reproduce

My default.nix:

 with import <nixpkgs> {};
 
 (let
   python = let
     packageOverrides = self: super: rec {
 
       numpy = super.numpy.overridePythonAttrs(old: rec {
         pname = "numpy";
         version = "1.13.1";
         src = super.fetchPypi {
            inherit pname version;
            format = "wheel";
            python = "cp36";
            abi = "cp36m";
            platform = "manylinux1_x86_64";
            sha256 = "d910a24f536f926bd56fb30d6f17ae8b89a1406e105087a49e014e000b00e8db";
         };
       });
     };
   in pkgs.python3.override {inherit packageOverrides;};
 
 in python.withPackages(ps: with ps; [
 numpy
 ])).env

Just run nix-shell in dir with default.nix;

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

  • system: "x86_64-linux"
  • host os: Linux 4.4.0-130-generic, Ubuntu, 16.04.4 LTS (Xenial Xerus)
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.0.4
  • channels(user): "nixpkgs-18.09pre144939.14a9ca27e69"
  • nixpkgs: /home/user/.nix-defexpr/channels/nixpkgs
@FRidh
Copy link
Member

FRidh commented Jul 13, 2018

You will also need to pass format = "wheel"; to buildPythonPackage / overridePythonAttrs.

@ghost
Copy link
Author

ghost commented Jul 13, 2018

Why could this happen: when I download numpy in my terminal via pip downoad --only-binary=:all: numpy, it fetches the wheel with those attributes, that I wrote in default.nix. But when I try to execute nix-shell it terminates with this error:

building '/nix/store/izcfrggm4za36lnlrcglwxm7v9mzg7cy-numpy-1.13.1-cp35-cp35m-manylinux1_x86_64.whl.drv'...

trying https://files.pythonhosted.org/packages/cp35/n/numpy/numpy-1.13.1-cp35-cp35m-manylinux1_x86_64.whl
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 16.1M  100 16.1M    0     0  6307k      0  0:00:02  0:00:02 --:--:-- 8999k
copying path '/nix/store/prswrxbr817yfczkclw8d9gagmwnfbc3-python3.5-coverage-4.5.1' from 'https://cache.nixos.org'...
copying path '/nix/store/19hsvj2l63f5slddz2z8sphj65mqdn42-python3.5-nose-1.3.7' from 'https://cache.nixos.org'...
building '/nix/store/xa8551mzxv7cp5k91awj8yms3f8hnv08-python3.5-numpy-1.13.1.drv'...
unpacking sources
patching sources
configuring
building
installing
/tmp/nix-build-python3.5-numpy-1.13.1.drv-0/dist /tmp/nix-build-python3.5-numpy-1.13.1.drv-0
numpy-1.13.1-cp35-cp35m-manylinux1_x86_64.whl is not a supported wheel on this platform.
builder for '/nix/store/xa8551mzxv7cp5k91awj8yms3f8hnv08-python3.5-numpy-1.13.1.drv' failed with exit code 1
cannot build derivation '/nix/store/zm60ajzx74n3zlymcappggis2cqgkxzm-python3-3.5.5-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/zm60ajzx74n3zlymcappggis2cqgkxzm-python3-3.5.5-env.drv' failed

@FRidh
Copy link
Member

FRidh commented Jul 13, 2018

I'm pretty sure because we are no longer manylinux1-compatible
#18484

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant