Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: Imageio Pillow requires Pillow, not PIL! #748

Closed
Swiffers opened this issue Mar 18, 2018 · 5 comments
Closed

ImportError: Imageio Pillow requires Pillow, not PIL! #748

Swiffers opened this issue Mar 18, 2018 · 5 comments

Comments

@Swiffers
Copy link

hi,

I'm falling into this error,

Traceback (most recent call last):
  File "./script.py", line 255, in add_watermark
    watermark = (ImageClip("./watermark.png")
  File "/usr/lib/python2.7/site-packages/moviepy/video/VideoClip.py", line 968, in __init__
    img = imread(img)
  File "/usr/lib/python2.7/site-packages/imageio/core/functions.py", line 185, in imread
    reader = read(uri, format, 'i', **kwargs)
  File "/usr/lib/python2.7/site-packages/imageio/core/functions.py", line 105, in get_reader
    format = formats.search_read_format(request)
  File "/usr/lib/python2.7/site-packages/imageio/core/format.py", line 660, in search_read_format
    if format.can_read(request):
  File "/usr/lib/python2.7/site-packages/imageio/core/format.py", line 189, in can_read
    return self._can_read(request)
  File "/usr/lib/python2.7/site-packages/imageio/plugins/pillow.py", line 57, in _can_read
    Image = self._init_pillow()
  File "/usr/lib/python2.7/site-packages/imageio/plugins/pillow.py", line 43, in _init_pillow
    raise ImportError('Imageio Pillow requires Pillow, not PIL!')
ImportError: Imageio Pillow requires Pillow, not PIL!
@tburrows13
Copy link
Collaborator

Well presumable you only have PIL installed, and not Pillow. If you run pip list, presumably Pillow is not listed. Run pip install pillow to install it.

FYI, PIL is the Python Imaging Library, which hasn't been updated since 2011. Pillow is a fork of PIL, which is regularly updated, and should be used instead.

@Swiffers
Copy link
Author

Swiffers commented Mar 19, 2018

It seems to be installed

> sudo pip install pillow
Requirement already satisfied: pillow in /usr/lib64/python2.7/site-packages

@tburrows13
Copy link
Collaborator

I’m no expert, but in your original post, the location was /usr/lib/python2.7/ but in your pip command, the location is /usr/lib64/python2.7/. I’m guessing you have 2 installs of python on your system, one 32-bit and one 64-bit.

@Swiffers
Copy link
Author

@tburrows13 Well spotted, I solved the issue by running:
pip install --target=/usr/lib/python2.7/site-packages/ --upgrade pillow

@chrischma
Copy link

For anyone who stumbles about this problem aswell, this worked for me:
danijar/handout#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants