Python poetry cannot install pynput and python-iptc

One solution is to pass in C_INCLUDE_PATH with linux headers to the environment. evdev looks there as seen here python-evdev/setup.py at c4dee7d93e068492d59c5f856cf2129cc11892bc · gvalkov/python-evdev · GitHub

So it can look something like this for a simple shell.nix:

{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {
    packages = with pkgs; [
    python311Full
    linuxHeaders
  ];

  C_INCLUDE_PATH = "${pkgs.linuxHeaders}/include";
}
1 Like