What did you do?
pip install -h |grep target
# -t, --target <dir> Install packages into <dir>. By default this
# multiple platforms supported by the target
# abis supported by the target interpreter.
mkdir -p packages
# remove the Pillow, which installed into system packages
pip uninstall Pillow
pip install -t packages Pillow
What did you expect to happen?
It imports plugins correctly
What actually happened?
It can't import plugins, when I didn't install Pillow into system packages directories
What are your OS, Python and Pillow versions?
- OS: Debian
- Python: 3.8.0
- Pillow: All versions
The real format of the image is webp, you need to import PIL.WebPImagePlugin. The image is as follows:

from packages.PIL import Image
with open('3ae6c099102fba7a4773c3568edee0be.jpg', 'rb') as fr:
Image.open(fr)
Traceback (most recent call last):
File "test2.py", line 4, in <module>
Image.open(fr)
File "/app/packages/PIL/Image.py", line 3023, in open
raise UnidentifiedImageError(
packages.PIL.UnidentifiedImageError: cannot identify image file <_io.BufferedReader name='3ae6c099102fba7a4773c3568edee0be.jpg'>
What did you do?
What did you expect to happen?
It imports plugins correctly
What actually happened?
It can't import plugins, when I didn't install Pillow into system packages directories
What are your OS, Python and Pillow versions?
The real format of the image is webp, you need to import PIL.WebPImagePlugin. The image is as follows: