Trying to override Python package and getting errors

I’m trying to change the version for python311Packages.pillow ( I’m using the following overlay:

    packageVersionsOverlay = self: super:
        python310 = super.python310.override {
          packageOverrides = pyself: pysuper: {

            pillow = pysuper.pillow.overridePythonAttrs (pillowAttrs: rec {
              doCheck = false;
              version = "9.5.0";
              src = pysuper.fetchPypi {
                inherit version;
                pname = "Pillow";
                hash = "sha256-v1SEedM2cm16Ds6252fhefveN4M65CeUYCYxoHDWMPE=";

which I think makes sense? I think use it in my derivation:

  py = pkgs.python310Packages;
in py.buildPythonPackage {
   propagatedBuildInputs = with py; [

but I get a build error that zlib is missing:

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:

I don’t get this error without the overlay since zlib is included in the buildInputs (, but shouldn’t I also have that same buildInputs?

You might need to reproduce a little more of how 9.5 was packaged.

Oh, thanks! I think that fixed it