Using Pillow with Python 3

心已入冬 提交于 2019-11-28 07:33:31
user198845

After much digging, and since there's been no other answer forthcoming, I'll answer my own question. This works for the pillow installation for python3.4:

$ sudo apt-get install python3-dev python3-setuptools

$ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev \
    libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev python-tk

$ sudo apt-get install python3-pip

$ sudo pip3 install Pillow

$ sudo apt-get install imagemagick

$ sudo ln -s /usr/bin/display /usr/bin/xv

Then in the python3.4 interactive shell enter:

>>> from PIL import Image

>>> im = Image.open("someimage.jpg")
>>> im.show()

And voilá, the image appears!

Most helpful sites:

http://pillow.readthedocs.org/en/latest/installation.html

https://askubuntu.com/questions/427358/install-pillow-for-python-3

Python 3 is a beautiful language, and it's getting there, but installing and using its imaging library shouldn't be so hard to do!

The reason you get this error is that you have not correctly installed python interpreter or your pip folder is misplaces. Simply download a [new interpreter] (https://www.python.org/downloads/)! and you are good to go.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!