As @spwhitton found: The test suite needs to call "python3 -m ocrmypdf.main" instead of just "ocrmypdf" because this /usr/bin/ocrmypdf script has not yet been generated when dh runs the test suite. --- Seems reasonable to perform in-place testing independent of installation. Source: https://sources.debian.net/src/ocrmypdf/4.2.1%2Bgit.20160824.1.5d67cc7-1/debian/patches/0001-patch-test-suite-executable.patch/