Why can't Python import Image from PIL?

后端 未结 17 1856
执念已碎
执念已碎 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条回答
  •  我在风中等你
    2020-12-03 06:58

    All the answers were great however what did it for me was a combination of uninstalling Pillow

    pip uninstall Pillow
    

    Then installing whatever packages you need e.g.

    sudo apt-get -y install python-imaging
    sudo apt-get -y install zlib1g-dev
    sudo apt-get -y install libjpeg-dev
    

    And then using easy_install to reinstall Pillow

    easy_install Pillow
    

    Hope this helps others

提交回复
热议问题