Best practices for installing PIL on stock Python 2.7 for a

Posted on
Thu Jan 10, 2019 7:24 pm
mundmc offline
User avatar
Posts: 487
Joined: Sep 14, 2012

Best practices for installing PIL on stock Python 2.7 for a

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!

Posted on
Thu Jan 10, 2019 8:03 pm
DaveL17 offline
User avatar
Posts: 4848
Joined: Aug 20, 2013
Location: Chicago, IL, USA

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

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.
Last edited by DaveL17 on Fri Jan 11, 2019 5:48 am, edited 1 time in total.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Thu Jan 10, 2019 11:53 pm
CliveS offline
Posts: 402
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

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

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

CliveS

Indigo 7.3.1 : MacOS High Sierra 10.13.6 : Mac mini Server (Mid 2011) : 2 GHz Core i7. : 8 GB. : 2 x 256GB Samsung EVO SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Fri Jan 11, 2019 1:05 am
siclark offline
Posts: 889
Joined: Jun 13, 2017
Location: UK

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

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.

Posted on
Fri Jan 11, 2019 7:06 am
mundmc offline
User avatar
Posts: 487
Joined: Sep 14, 2012

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

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!

Posted on
Sun Jan 20, 2019 8:50 pm
mundmc offline
User avatar
Posts: 487
Joined: Sep 14, 2012

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

Thanks all, it worked.

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

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest