Pillow vs PIL

1,041 views
Skip to first unread message

Joe Percival

unread,
Mar 7, 2017, 6:19:42 PM3/7/17
to weewx-user
I followed the setup.py installation instructions.
One of those instructions is to execute:
  sudo apt-get install python-imaging

From what I have read, under Ubuntu, this may install Pillow instead of the older PIL, and I have seen suggestions that this may result in the need to install more support packages to handle different image formats.

Is this "old news" that I don't need to be concerned about or ???

FYI, not only will I be generating Weewx graphics, but I will also be "doctoring" images downloaded from some webcams.

Thanks,
joe

vince

unread,
Mar 7, 2017, 6:31:02 PM3/7/17
to weewx-user
On Tuesday, March 7, 2017 at 3:19:42 PM UTC-8, Joe Percival wrote:
I followed the setup.py installation instructions.
One of those instructions is to execute:
FYI, not only will I be generating Weewx graphics, but I will also be "doctoring" images downloaded from some webcams.


Dunno about doctoring, but the instructions have worked for me always.

Which version of ubuntu are you trying to use ?
And why ubuntu and not debian, just curious there....

Thomas Keffer

unread,
Mar 7, 2017, 6:31:54 PM3/7/17
to weewx-user
It's not something you generally need to be concerned about. Pillow is a maintained fork of PIL, which was abandoned years ago. For example, it works under Python 3, and can be installed using pip (instead of from source).

Same code base, just maintained. 

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alec Bennett

unread,
Mar 7, 2017, 6:52:21 PM3/7/17
to weewx-user
Personally I'd highly recommend Pillow. I got endless import errors when I used the "apt-get install python-imaging" method of installing PIL. I'd fix one import error and have to deal with the next.

I finally switched to Pillow and all my issues went away.

Note that I installed Pillow via Pip:

# a couple of dependencies first

apt-get -y install libfreetype6-dev  # need this first or get libfreetype errors

apt-get -y install libjpeg-dev


# install Pillow through pip

pip install pillow


I've found the best way to install pip is:

wget https://bootstrap.pypa.io/get-pip.py

sudo python get-pip.py





To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.

Thomas Keffer

unread,
Mar 7, 2017, 7:02:29 PM3/7/17
to weewx-user
On Tue, Mar 7, 2017 at 3:52 PM, Alec Bennett <wryb...@gmail.com> wrote:
I got endless import errors when I used the "apt-get install python-imaging" method of installing PIL. I'd fix one import error and have to deal with the next.


​Do you have an example of this? Was it while installing/running weewx? or, something else?

-tk​

Alec Bennett

unread,
Mar 7, 2017, 7:17:09 PM3/7/17
to weewx...@googlegroups.com
​Do you have an example of this? Was it while installing/running weewx? or, something else?

When running weewx I'd get an import error for "_imaging" in the syslog. It's a common error with a lot of Google results, and a commonly recommended solution is to install Pillow, which did it for me. That said, it was a long troubleshooting session and things got confusing, and it's very possible it was user error.

I'll experiment the next time I install from scratch to see if I can reproduce the error.





--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/6yG2oibveVw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+unsubscribe@googlegroups.com.

Thomas Keffer

unread,
Mar 7, 2017, 7:49:14 PM3/7/17
to weewx-user
Please do. I'd like to see the error. PIL should work with weewx.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.

vince

unread,
Mar 7, 2017, 8:20:49 PM3/7/17
to weewx-user
On Tuesday, March 7, 2017 at 4:49:14 PM UTC-8, Tom Keffer wrote:
Please do. I'd like to see the error. PIL should work with weewx.



Probably only loosely related, but the same "apt-get install" commands work in order to install weewx via setup.py for both Ubuntu xenial64 and Debian jessie64, both of which use systemd.   This is a snippet from an ansible playbook, but it should be pretty obvious.  First section would be "apt-get install -y" then a list, second is "pip install" then a list.  Just like the docs say.  I run nginx here for the webserver, which you'll see in the list below.

    - name: install packages
      package:  name={{ item }} state=present
      with_items:
        - apt-transport-https
        - sqlite3
        - wget
        - curl
        - ntp
        - procps
        - nginx
        - python-configobj
        - python-cheetah
        - python-imaging
        - python-serial
        - python-usb
        - python-dev
        - python-pip
        - openssh-server
        - xtide
        - xtide-data

    - name: install pyephem
      pip:
        name: pyephem


I install xtide and pyephem because I fiddle with the forecast module and astronomical stuff, but they're not strictly required for a vanilla system.

If anybody wants the full Vagrantfile and ansible playbook, email me and I'll put it up on github when I get a chance....


Reply all
Reply to author
Forward
0 new messages