"Illegal instruction" on Raspbery Pi Zero
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
How did you install Pillow? If through pip, could you mention which wheel was used?
pip install pillow or as a dependency in luma.core.
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?
https://www.piwheels.org/simple/pillow/Pillow-9.0.0-cp39-cp39-linux_armv6l.whl
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.
after issuing python3 -m pip install Pillow==9.0.0 --no-binary :all: command, error is not appearing any more
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
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
For reference, here's the piwheels issue: https://github.com/piwheels/packages/issues/269
Thanks for reporting!