Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3499462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:36:52+00:00 2026-05-18T12:36:52+00:00

In the process of trying to write a Python script that uses PIL today,

  • 0

In the process of trying to write a Python script that uses PIL today, I discovered I don’t seem have it on my local machine (OS X 10.5.8, default 2.5 Python install).

So I run:

easy_install --prefix=/usr/local/python/ pil

and it complains a little about /usr/local/python/lib/python2.5/site-packages not yet existing, so I create it, and try again, and get this:

TEST FAILED:
/usr/local/python//lib/python2.5/site-packages
does NOT support .pth files error: bad
install directory or PYTHONPATH

You are attempting to install a
package to a directory that is not on
PYTHONPATH and which Python does not
read “.pth” files from. The
installation directory you specified
(via –install-dir, –prefix, or the
distutils default setting) was:

/usr/local/python//lib/python2.5/site-packages

and your PYTHONPATH environment
variable currently contains:

''

OK, fair enough — I hadn’t done anything to set the path. So I add a quick line to ~/.bash_profile:

PYTHONPATH=”$PYTHONPATH:/usr/local/python/lib/python2.5″

and source it, and try again.

Same error message.

This is kindof curious, given that PYTHONPATH is clearly set; I can echo $PYTHONPATH and get back :/usr/local/python/lib/python2.5. I decided to check out what the include path looked like from inside:

import sys
print "\n".join(sys.path)

which yields:

/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload
/Library/Python/2.5/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC

from which /usr/local/python/yadda/yadda is notably missing.

Not sure what I’m supposed to do here. How do I get python to recognize this location as an include path?

UPDATE

As Sven Marnach suggested, I was neglecting to export PYTHONPATH. I’ve corrected that problem, and now see it show up when I print out sys.path from within Python. However, I still got the TEST FAILED error message I mentioned above, just with my new PYTHONPATH environment variable.

So, I tried changing it from /usr/local/python/lib/python2.5 to /usr/local/python/lib/python2.5/site-packages, exporting, and running the same easy_install command again. This leads to an all new result that at first looked like success (but isn’t):

Creating /usr/local/python/lib/python2.5/site-packages/site.py
Searching for pil
Reading http://pypi.python.org/simple/pil/
Reading http://www.pythonware.com/products/pil
Reading http://effbot.org/zone/pil-changes-115.htm
Reading http://effbot.org/downloads/#Imaging
Best match: PIL 1.1.7
Downloading http://effbot.org/media/downloads/PIL-1.1.7.tar.gz
Processing PIL-1.1.7.tar.gz
Running PIL-1.1.7/setup.py -q bdist_egg --dist-dir /var/folders/XW/XWpClVq7EpSB37BV3zTo+++++TI/-Tmp-/easy_install-krj9oR/PIL-1.1.7/egg-dist-tmp--Pyauy
--- using frameworks at /System/Library/Frameworks
[snipped: compiler warnings]
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      darwin 2.5.1 (r251:54863, Sep  1 2010, 22:03:14)
              [GCC 4.0.1 (Apple Inc. build 5465)]
--------------------------------------------------------------------
--- TKINTER support available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available
--------------------------------------------------------------------
To add a missing option, make sure you have the required
library, and set the corresponding ROOT variable in the
setup.py script.

To check the build, run the selftest.py script.
zip_safe flag not set; analyzing archive contents...
Image: module references __file__
No eggs found in /var/folders/XW/XWpClVq7EpSB37BV3zTo+++++TI/-Tmp-/easy_install-krj9oR/PIL-1.1.7/egg-dist-tmp--Pyauy (setup script problem?)

Again, this looks good, but when I go to run my script:

Traceback (most recent call last):
File “checkerboard.py”, line 1, in

import Image, ImageDraw ImportError: No module named Image

When I check what’s now under /usr/local/python/ using find ., I get:

./lib ./lib/python2.5
./lib/python2.5/site-packages
./lib/python2.5/site-packages/site.py
./lib/python2.5/site-packages/site.pyc

So… nothing module-looking (I’m assuming site.py and site.pyc are metadata or helper scripts). Where did the install go?

I note this:

To check the build, run the
selftest.py script.

But don’t really know what that is.

And I also noticed the “No eggs found” message. Are either of these hints?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:36:53+00:00Added an answer on May 18, 2026 at 12:36 pm

    You are using the Apple-supplied Python 2.5 in OS X; it’s a framework build and, by default, uses /Library/Python/2.5/site-packages as the location for installed packages, not /usr/local. Normally you shouldn’t need to specify --prefix with an OS X framework build. Also beware that the setuptools (easy_install) supplied by Apple with OS X 10.5 is also rather old as is the version of Python itself.

    That said, installing PIL completely and correctly on OS X especially OS X 10.5 is not particularly simple. Search the archives or elsewhere for tips and/or binary packages. Particularly if you are planning to use other modules like MySQL or Django, my recommendation is to install everything (Python and PIL) using a package manager like MacPorts.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a python script that packages our software. This script needs
I'm trying to write a batch process that can take an MP3 file and
I'm a newbie and I'm trying to write a python script to build rpm
i'm trying to write a script which would process certain files. The data are
I'm trying to write a program to process the BSD-style process accounting file under
I am trying to process files one at a time that are stored over
What I'm trying to do is to write a script which would open an
I'm trying to write a video application in PyQt4 and I've used Python ctypes
I'm trying to write a professional program to accept and process input via a
I'm in the process of trying to hack together the first bits of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.