Why can't Python import Image from PIL?

后端 未结 17 1813
执念已碎
执念已碎 2020-12-03 06:49

The single line that I am trying to run is the following:

from PIL import Image

However simple this may seem, it gives an error:

         


        
17条回答
  •  -上瘾入骨i
    2020-12-03 07:00

    I had the same error. Here was my workflow. I first installed PIL (not Pillow) using

    pip install --no-index -f https://dist.plone.org/thirdparty/ -U PIL
    

    Then I found Pillow and installed it using

    pip install Pillow
    

    What fixed my issues was uninstalling both and reinstalling Pillow

    pip uninstall PIL
    pip uninstall Pillow
    pip install Pillow
    

提交回复
热议问题