[Python] picframe Install on Raspberry Pi 3B, Bullseye OS, pi-heif wheel fails to build

Discussão em 'Python' iniciado por Stack, Agosto 5, 2025.

  1. Stack

    Stack Membro Participativo

    Novice Raspberry Pi user here trying to build a digital picture frame. The problem I'm running into is the pi-heif wheel won't successfully build.

    I'm using Python3.11.2, the latest libheif library is installed, and I've run all the precursory installs necessary (sudo apt-get update, python3 -m pip install -U pip, etc).

    Looking through pi-heif or pillow-heif documentation doesn't provide any alternative install options or troubleshooting help.

    When trying to run python3 -m pip install pi-heif or any variation of it, I'm given the error codes :

    error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
    ERROR: Failed building wheel for pi-heif


    I'm wondering if anyone has run into a similar problem or successfully installed pi-heif on their raspberry pi? It seems to fail building on the Bookworm OS but there are a number of accounts I can find of people using picframe on their raspberries. Any insight would be greatly appreciated!

    Full error message:

    bash ~ $python3 -m pip install pi-heif
    Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Collecting pi-heif
    Using cached pi_heif-0.20.0.tar.gz (16.2 MB)
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Preparing metadata (pyproject.toml) ... done
    Requirement already satisfied: pillow>=10.1.0 in ./vene/lib/python3.11/site-packages (from pi-heif) (11.0.0)
    Building wheels for collected packages: pi-heif
    Building wheel for pi-heif (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Building wheel for pi-heif (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [46 lines of output]
    running bdist_wheel
    running build
    running build_py
    creating build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/constants.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/heif.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/_deffered_error.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/misc.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/AvifImagePlugin.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/options.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/HeifImagePlugin.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/as_plugin.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/_lib_info.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/_version.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    copying pi_heif/__init__.py -> build/lib.linux-armv7l-cpython-311/pi_heif
    running build_ext
    Looking for `libheif` using pkg-config.
    Checking for include file 'heif.h' in '/usr/include/arm-linux-gnueabihf'
    Checking for include file 'heif.h' in '/usr/include/arm-linux-gnueabihf/libheif'
    Found 'heif.h' in '/usr/include/arm-linux-gnueabihf/libheif'
    building '_pi_heif' extension
    creating build/temp.linux-armv7l-cpython-311/pi_heif
    arm-linux-gnueabihf-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/arm-linux-gnueabihf -I/usr/include -I/home/serbu/vene/include -I/usr/local/include -I/home/serbu/vene/include -I/usr/include/python3.11 -c pi_heif/_pi_heif.c -o build/temp.linux-armv7l-cpython-311/pi_heif/_pi_heif.o -Ofast -Werror
    pi_heif/_pi_heif.c: In function ‘_CtxAuxImage’:
    pi_heif/_pi_heif.c:760:21: error: implicit declaration of function ‘heif_image_handle_get_preferred_decoding_colorspace’ [-Werror=implicit-function-declaration]
    760 | if (check_error(heif_image_handle_get_preferred_decoding_colorspace(aux_handle, &colorspace, &chroma))) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    pi_heif/_pi_heif.c:760:21: error: incompatible type for argument 1 of ‘check_error’
    760 | if (check_error(heif_image_handle_get_preferred_decoding_colorspace(aux_handle, &colorspace, &chroma))) {
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | |
    | int
    pi_heif/_pi_heif.c:14:35: note: expected ‘struct heif_error’ but argument is of type ‘int’
    14 | int check_error(struct heif_error error) {
    | ~~~~~~~~~~~~~~~~~~^~~~~
    pi_heif/_pi_heif.c: In function ‘_get_aux_type’:
    pi_heif/_pi_heif.c:1310:5: error: implicit declaration of function ‘heif_image_handle_release_auxiliary_type’; did you mean ‘heif_image_handle_free_auxiliary_types’? [-Werror=implicit-function-declaration]
    1310 | heif_image_handle_release_auxiliary_type(aux_handle, &aux_type_c);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    | heif_image_handle_free_auxiliary_types
    pi_heif/_pi_heif.c: In function ‘_load_file’:
    pi_heif/_pi_heif.c:1510:21: error: incompatible types when assigning to type ‘struct heif_error’ from type ‘int’
    1510 | error = heif_image_handle_get_preferred_decoding_colorspace(handle, &colorspace, &chroma);
    | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cc1: all warnings being treated as errors
    error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for pi-heif
    Failed to build pi-heif
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml b
    ```ased projects (pi-heif)

    Continue reading...

Compartilhe esta Página