Pypi wheel package

I’m trying to use this pypi package vosk · PyPI

with the following shell.nix

with import <nixpkgs> {};

( let
    vosk = python38.pkgs.buildPythonPackage rec {
      pname = "vosk";
      version = "0.3.21";

      src = python38.pkgs.fetchPypi {
        inherit pname version;
        sha256 = "7123be9f7580f8e5fe61e6f9afeda82e2bf5ed382d6a31fa76f05f9463b1109d";
        format = "wheel";
        python = "py3";
        platform = "manylinux2010_x86_64";

      doCheck = false;

in python38.withPackages (ps:

but got this error:

unpacking source archive /nix/store/5lkac8alf7qxcjs99945h9lx026783ms-vosk-0.3.21-py3-none-manylinux2010_x86_64.whl
do not know how to unpack source archive /nix/store/5lkac8alf7qxcjs99945h9lx026783ms-vosk-0.3.21-py3-none-manylinux2010_x86_64.whl

why is that?

You have to tell buildPythonPackage to that it is dealing with a wheel.
So you can add format = "wheel" as an input to buildPythonPackage as well as fetchPypi.

1 Like

That fixed it. Thanks.
However I got another error (cffi) and ended up with mach-nix instead.

1 Like