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: 1060
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: 6753
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: 770
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 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB 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: 1960
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: 1060
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: 1060
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 9 guests