Pillow icon indicating copy to clipboard operation
Pillow copied to clipboard

"Illegal instruction" on Raspbery Pi Zero

Open tomekgorski opened this issue 4 years ago • 9 comments

Importing Image or ImageDraw from Pillow results in "Illegal instruction" error

  • Platform: Raspbery Pi Zero W
  • OS: Raspbian GNU/Linux 11 (bullseye)
  • Python: Python 3.9.2 (default, Mar 12 2021, 04:06:34)
  • Pillow: 9.0.0
from PIL import Image

or

from PIL import ImageDraw

ps: Pillow 8.4.0 works OK

tomekgorski avatar Jan 04 '22 00:01 tomekgorski

How did you install Pillow? If through pip, could you mention which wheel was used?

radarhere avatar Jan 04 '22 00:01 radarhere

pip install pillow or as a dependency in luma.core.

tomekgorski avatar Jan 04 '22 00:01 tomekgorski

When I run python3 -m pip install Pillow on my machine, part of the output is

Collecting Pillow
  Downloading Pillow-9.0.0-cp38-cp38-macosx_11_0_arm64.whl (2.7 MB)
     |████████████████████████████████| 2.7 MB 3.6 MB/s 
Installing collected packages: Pillow
Successfully installed Pillow-9.0.0

What is the .whl name when you install Pillow?

radarhere avatar Jan 04 '22 00:01 radarhere

https://www.piwheels.org/simple/pillow/Pillow-9.0.0-cp39-cp39-linux_armv6l.whl

tomekgorski avatar Jan 04 '22 00:01 tomekgorski

Thanks.

If you uninstall Pillow, and then run python3 -m pip install Pillow --no-binary :all:, does Pillow work for you then? --no-binary :all: will compile Pillow from source, instead of using the binary wheel.

radarhere avatar Jan 04 '22 01:01 radarhere

after issuing python3 -m pip install Pillow==9.0.0 --no-binary :all: command, error is not appearing any more

tomekgorski avatar Jan 04 '22 14:01 tomekgorski

Thanks for checking. In that case, I don't think this is a problem with Pillow itself.

Since we didn't create that wheel, I suggest you raise an issue at https://github.com/piwheels/packages

radarhere avatar Jan 04 '22 21:01 radarhere

For me, the same problem occurs.

Platform: Raspbery Pi Zero W OS: Raspbian GNU/Linux 11 (bullseye) Python: Python 3.9.2 (default, Mar 12 2021, 04:06:34) Pillow: 9.0.0

sudo pip3 uninstall pillow python3 -m pip install Pillow==9.0.0 --no-binary :all:

"Illegal instruction" error is not appearing any more

darton avatar Jan 04 '22 21:01 darton

For reference, here's the piwheels issue: https://github.com/piwheels/packages/issues/269

Thanks for reporting!

hugovk avatar Jan 05 '22 06:01 hugovk