[Tutor] importing from PIL

Alan Gauld alan.gauld at yahoo.co.uk
Tue Aug 11 20:44:46 EDT 2020


On 12/08/2020 00:46, Chris Roy-Smith wrote:
> Hi
> Ubuntu 18.04
> python3.8
> 
> under these conditions I get
> 
>  >>> from PIL import Image
> Traceback (most recent call last):
>    File "<stdin>", line 1, in <module>
>    File "/usr/lib/python3/dist-packages/PIL/Image.py", line 60, in <module>
>      from . import _imaging as core
> ImportError: cannot import name '_imaging' from 'PIL' 
> (/usr/lib/python3/dist-packages/PIL/__init__.py)
> 
> If I do the same in python 3.6 on the same computer, this command does 
> not raise an error.
> 
> How do I proceed from here?


Are you sure your version of Pillow is compatible with 3.8?
PIL/Pilow has a long tradition of being a release or two behind
the bleeding edge. (One reason I usually leave a couple of
releases before upgrading...)

Is there a reason you upgraded to 3.8? Is there anything in
it that you need that isn't in 3.6?

Or is there an updated PIL/Pillow that works with 3.8?

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list