Page 1 of 1

Best practices for installing PIL on stock Python 2.7 for a

PostPosted: Thu Jan 10, 2019 7:24 pm
by mundmc
This is something I really should know how to do, though I still have concerns about screwing up my Python installation.

How do I install PIL to my base Python install?

I have a fun little tool I made to format and wrap text to a predefined size, to be displayed as a refreshing image.

The import line is:
Code: Select all
from PIL import Image, ImageDraw, ImageFont


I have read about pip and easyinstall, though I have seen very different bits of advice on the internet. Many thanks in advance!

Re: Best practices for installing PIL on stock Python 2.7 fo

PostPosted: Thu Jan 10, 2019 8:03 pm
by DaveL17
Going from memory, I think you might want to take a look at Pillow--I believe that Pillow is maintained where PIL isn't--I could be fuzzy on that, though. I've found that using pip to install packages leaves stock Python alone where other installers like Macports and Homebrew have real risks.

Here's another thread with some ideas which does reference Pillow and PIL.

Re: Best practices for installing PIL on stock Python 2.7 fo

PostPosted: Thu Jan 10, 2019 11:53 pm
by CliveS
mundmc wrote:
I have read about pip and easyinstall, though I have seen very different bits of advice on the internet. Many thanks in advance!


For the correct advice take a look at https://forums.indigodomo.com/viewtopic.php?f=108&t=19126

Re: Best practices for installing PIL on stock Python 2.7 fo

PostPosted: Fri Jan 11, 2019 1:05 am
by siclark
The iTravel plugin also uses Pillow and I had a lot of pain trying to get it installed and tried macports and homebrew but you definitely don't want to do this as you need to install pillow into the Apple python instance. For that your best bet is Pip.

Re: Best practices for installing PIL on stock Python 2.7 fo

PostPosted: Fri Jan 11, 2019 7:06 am
by mundmc
Thanks all!
I will give this a go. It worked well on Pythonista.

- Yes, I believe the code needs Pillow
- Glad to avoid macports/ brew until i understand virtual environments better
- Dave- this kinda runs with your text-wrapper code, but I wanted to change font size and spacing based on the length of input and the desired box-size of the output. E.g. ‘Hello World’ is font 82 or something, but a complex message scales down as much as needed.

It’s good for pushing visual text alerts to my Domopad clients!

Re: Best practices for installing PIL on stock Python 2.7 fo

PostPosted: Sun Jan 20, 2019 8:50 pm
by mundmc
Thanks all, it worked.

Formatted text alerts pushed to Kindle 7 domopads!
https://r.tapatalk.com/shareLink?share_ ... are_type=t