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

package `pytrec-eval` not available from any of the selected providers.

Open quinn-dougherty opened this issue 3 years ago • 4 comments

When I put beir in requirements.txt:

The Package 'pytrec-eval' (build: ()) is not available from any of the selected providers ['nixpkgs', 'sdist', 'wheel']
 for the selected python version
The required package might just not (yet) be part of the dependency DB currently used.
The DB can be updated by specifying 'pypiDataRev' when importing mach-nix.
For examples see: https://github.com/DavHau/mach-nix/blob/master/examples.md
If it still doesn't work, there might have been an error while building the DB.
Please open an issue at: https://github.com/DavHau/mach-nix/issues/new

Same bug when I specify the latest commit of pypi-deps-db in pypiDataRev argument.

The pypi page for pytrec-eval is here: https://pypi.org/project/pytrec-eval/

quinn-dougherty avatar Sep 16 '22 08:09 quinn-dougherty

Is it because a download happens in setup.py, and would have to be overridden by a nix fetcher to be able to run? https://github.com/cvangysel/pytrec_eval/blob/master/setup.py

quinn-dougherty avatar Sep 18 '22 08:09 quinn-dougherty

@quinn-dougherty did you figure this out? I've spent all day trying to get a good python dev environment set up with beir and this same error is the closest I've made it :(

skeet70 avatar Aug 03 '23 21:08 skeet70

private repo, but

let
        pkgs = import nixpkgs { inherit system; };
        pytrec-eval = mach-nix.lib.${system}.buildPythonPackage {
          src = pkgs.fetchFromGitHub {
            owner = "cvangysel";
            repo = "pytrec_eval";
            rev = "0d8571efc2dea5a792358410d5affbe0ad383602";
            sha256 = "sha256-t76D3C5QMJgQMhAg8TGxdtjwaLQhlB8SufAdM3pAZg4=";
            fetchSubmodules = true;
          };
          pname = "pytrec_eval";
          version = "0.5";
          requirements = ''
            numpy>=1.15.1
            scipy>=1.1.0
          '';
        };
        autocast-replication =
          mach-nix.lib.${system}.buildPythonPackage { src = ./.; };
        python-environment = mach-nix.lib.${system}.mkPython {
          requirements = builtins.readFile ./requirements.txt;
          packagesExtra = [ pytrec-eval autocast-replication ];
          _.pandas-stubs.postInstall = ''
            rm $out/lib/python*/site-packages/pandas/_libs/{*.pyi,tslibs/*.pyi}
          '';
        };

(almost a year old, so update commit sha)

quinn-dougherty avatar Aug 03 '23 21:08 quinn-dougherty

Awesome, that worked for me too, thank you.

skeet70 avatar Aug 03 '23 21:08 skeet70