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

Can't use SPARQLWrapper in nix-shell (somewhat OT) #227

Open
ktk opened this issue Apr 22, 2023 · 0 comments
Open

Can't use SPARQLWrapper in nix-shell (somewhat OT) #227

ktk opened this issue Apr 22, 2023 · 0 comments

Comments

@ktk
Copy link

ktk commented Apr 22, 2023

I'm a complete Python noob and the only way I started using it recently is via ChatGPT to automate some things that are easy to do via Python. It proposes SPARQLWrapper a lot so I made a nix-config as well as I use nix for separate build environments.

However it looks like this fails really fast, given the following shell.nix file as config

{ pkgs ? import <nixpkgs> {} }:

let
  python = pkgs.python38;
  pkgs_python = python.withPackages(ps: with ps; [
    pandas
    SPARQLWrapper
  ]);
in
pkgs.mkShell {
  name = "my-python-env";
  buildInputs = [
    pkgs_python
  ];
}

and then run a nix-shell, it fails with

py-sparql-wrapper nix-shell
error: Package ‘python3.8-keepalive-0.5’ in /nix/store/qzmzxq7vh5lw5cisiiy1fgy5ifw0gxjp-nixpkgs/nixpkgs/pkgs/development/python-modules/keepalive/default.nix:19 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

        Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
        (Flake) command, `--impure` must be passed in order to read this
        environment variable.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

I used requests instead which worked fine as well but it would be nice to have SPARQLWrapper working as well.

Anyone ever saw this issue with keepalive? I could only trigger that with SPARQLWrapper so far.

If this is too offtopic and a pure nix-shell issue, let me know & close it.

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

No branches or pull requests

1 participant