# Need help for packaging python package (package not installed error)

**URL:** https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904
**Category:** Help
**Created:** [July 13, 2026, 8:25am UTC](https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904 "2026-07-13T08:25:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 13, 2026, 8:25am UTC](https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904/1 "2026-07-13T08:25:20Z")

</div>

I am trying to package `slidge` but I connot trick nix to thing its dependency `thumbhash` is installed.

`default.nix` like this:

```nix
{
  python3Packages,
  fetchFromGitea,
  fetchFromGitHub,
  writeText,
}:
let
  thumbhash = python3Packages.buildPythonPackage (finalAttrs: {
    pname = "thumbhash";
    version = "0.1.2";
    pyproject = true;

    src = fetchFromGitHub {
      owner = "justinforlenza";
      repo = "thumbhash-py";
      tag = "v0.1.2";
      hash = "sha256-caOMW2hB+Be0SJToWrE51qb+ex/iVRH29oHwfsIcTXw=";
    };

    build-system = with python3Packages; [
      hatchling
    ];

    dependencies = with python3Packages; [
      pillow
    ];

    doCheck = false;

    pythonImportsCheck = ["thumbhash"];

    patches = [
      (writeText "pyproject-fix.patch" ''
        --- a/pyproject.toml
        +++ b/pyproject.toml
        @@ -49,6 +49,9 @@ dependencies = [
         cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=thumbhash --cov=tests {args}"
         no-cov = "cov --no-cov {args}"

        +[tool.hatch.build.targets.wheel]
        +packages = ["thumbhash"]
        +
         [[tool.hatch.envs.test.matrix]]
         python = ["37", "38", "39", "310", "311"]
      '')
    ];

    meta = {
      # ...
    };
  });
in

python3Packages.buildPythonPackage (finalAttrs: {
  pname = "slidge";
  version = "0.3.11";
  pyproject = true;
  # dontCheckRuntimeDeps = true; # it cannot detech thumbhash installation

  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "slidge";
    repo = "slidge";
    tag = "v${finalAttrs.version}";
    hash = "sha256-IUfeNn/zp1iyMSu60VAtJ5A74Q9zTh37B+LFNa6VVLA=";
  };
  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail 'pillow~=11.0' 'pillow' \
      --replace-fail 'defusedxml~=0.7.1' 'defusedxml' \
      --replace-fail 'slixmpp~=1.14.1' 'slixmpp'
  '';

  build-system = with python3Packages; [
    setuptools-scm
  ];

  dependencies =
    with python3Packages;
    [
      slixmpp
      aiohttp
      qrcode
      configargparse
      blurhash

      alembic
      defusedxml
      pillow
      python-magic
      sqlalchemy
    ]
    ++ [
      thumbhash
    ];

  meta = {
    # ...
  };
})

```

When running `nix-build --expr 'with import <nixpkgs> {}; callPackage ./default.nix {}'` in the same folder, It throws error:

```auto
Successfully built slidge-0.3.11-py3-none-any.whl
Finished creating a wheel...
Finished executing pypaBuildPhase
Running phase: pythonRuntimeDepsCheckHook
@nix { "action": "setPhase", "phase": "pythonRuntimeDepsCheckHook" }
Executing pythonRuntimeDepsCheck
Checking runtime dependencies for slidge-0.3.11-py3-none-any.whl
  - thumbhash not installed

```

I cannot pass `pythonRuntimeDepsCheck` to trick `thumbhash` is installed unless I set `dontCheckRuntimeDeps = true;` and I think it is not a good solution. How can I solve this problem? Thanks!

---

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 13, 2026, 9:09am UTC](https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904/2 "2026-07-13T09:09:50Z")

</div>

Or is `dontCheckRuntimeDeps = true;` is the correct way to go? I found some packages in nixpkgs also use this line.

I just want to know why `pythonRuntimeDepsCheck` thinks it is not installed.

---

<div class="post-metadata">

### Author: ![kirillrdy](https://discourse.nixos.org/user_avatar/discourse.nixos.org/kirillrdy/32/6278_2.png) [@kirillrdy](https://discourse.nixos.org/u/kirillrdy)
#### Post date: [July 13, 2026, 9:51am UTC](https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904/3 "2026-07-13T09:51:15Z")

</div>

the issue is that slidge depends on “thumbhash” but [thumbhash-py/pyproject.toml at 9706ca2168b32a15388a616b4795e8c0a8ff8297 · justinforlenza/thumbhash-py · GitHub](https://github.com/justinforlenza/thumbhash-py/blob/9706ca2168b32a15388a616b4795e8c0a8ff8297/pyproject.toml) name is “thumbhash-py“ , on master they renamed it to thumbhash

you can patch name in pyproject.toml, or you can update to master version, or you can use `pythonRelaxDepsHook` in slidge to remove check for `thumbhash`

---

<div class="post-metadata">

### Author: ![mirror](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/3be4f8/32.png) [@mirror](https://discourse.nixos.org/u/mirror)
#### Post date: [July 13, 2026, 11:06am UTC](https://discourse.nixos.org/t/need-help-for-packaging-python-package-package-not-installed-error/78904/4 "2026-07-13T11:06:35Z")

</div>

> [@kirillrdy](#):
>
> pythonRelaxDepsHook

Thanks, patching name in pypreject.toml works! Its name in v0.1.2 branch is incorrect but in main branch it is correct… I was tricked by the main branch as I forgot to switch it.
