AttributeError: модуль 'PIL.ImageFile' не имеет атрибута 'ImageFile' - PullRequest
0 голосов
/ 16 апреля 2019

AttributeError: модуль 'PIL.ImageFile' не имеет атрибута 'ImageFile'

Я установил PIL с командой "pip install pillow"

From PIL import Image
sourceFileName = "source.png"
Avatar= Image.open(sourceFileName)
File "d:/sourcecode/test.py", line 3, in <module>
   Avatar= Image.open(sourceFileName)
File "C:\**\Python37-32\lib\site-packages\PIL\Image.py", line 2663, in open
   Preinit()
File "C:\**\Python37-32\lib\site-packages\PIL\Image.py", line 381, in preinit
   From . import BmpImagePlugin
File "C:\**\Python37-32\lib\site-packages\PIL\BmpImagePlugin.py", line 61, in <module>
   Class BmpImageFile(ImageFile.ImageFile):
AttributeError: module 'PIL.ImageFile' has no attribute 'ImageFile'
...