最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

python - picframe Install on Raspberry Pi 3B, Bullseye OS, pi-heif wheel fails to build - Stack Overflow

matteradmin5PV0评论

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: , 
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)

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./simple, https://www.piwheels./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)
Share Improve this question asked Nov 16, 2024 at 16:37 Sandra SerbuSandra Serbu 111 bronze badge 2
  • python3 -m pip install wheel – user4136999 Commented Nov 16, 2024 at 18:41
  • pip3 install wheel – user4136999 Commented Nov 16, 2024 at 18:48
Add a comment  | 

1 Answer 1

Reset to default 0

Requirement already satisfied: pillow>=10.1.0 in ./vene/lib/python3.11/site-packages (from pi-heif) (11.0.0)

You need to install latest PILLOW version 11.0.0.

Mine is older version 9.5.0.

On your side, you need to install python3 -m pip install wheel before install pi-heif.

Today, I tried your command python3 -m pip install pi-heif

Here you can see my output using Bullseye Pi 3B:

supra@pi:~ $ python3 -m pip install pi-heif
Looking in indexes: https://pypi./simple, https://www.piwheels./simple
Collecting pi-heif
  Downloading pi_heif-0.20.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (936 kB)
     |████████████████████████████████| 936 kB 4.2 MB/s 
Collecting pillow>=10.1.0
  Downloading pillow-11.0.0-cp39-cp39-manylinux_2_28_aarch64.whl (4.2 MB)
     |████████████████████████████████| 4.2 MB 6.3 MB/s 
Installing collected packages: pillow, pi-heif
  Attempting uninstall: pillow
    Found existing installation: Pillow 9.5.0
    Uninstalling Pillow-9.5.0:
      Successfully uninstalled Pillow-9.5.0
Successfully installed pi-heif-0.20.0 pillow-11.0.0

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far