[Setup] Re: PIL is not installed properly

Joe Bigler jeb6 at psu.edu
Wed Aug 16 14:38:17 UTC 2006


I did find a solution that works.  This eliminates the warning message and hopefully installs PIL correctly for Plone to use.  I am running

Plone 2.5,
Zope (Zope 2.9.3, python 2.4.2, win32),
Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)],
PIL 1.1.5

1.  Download the Windows installer for Python 2.4.2 from Python.org  It isn't on the first download page so need to do a search for 2.4.2.
2.  Stop Zope
3.  Install Python 2.4.2 in the same directory as the Python installed by Zope.  In my case, I picked the directory with the Python.exe in it which is
C:\Program Files\Zope-2.9.3\bin
4. Download the Pil Windows installer.  I used PIL-1.1.5.win32-py2.4.exe
5.  Install PIL.  It will now see the Python installed in Zope as the registered version of Python.
6.  Start Zope
7.  Go to site setup in any Plone installation.  The warning message should not appear anymore.  This was the original warning message:

Warning: PIL is not installed properly, image scaling will not work.

I have not tested this thoroughly since I just installed it yesterday, but so far, it seems to work.  

I tried running a script that was at 

http://www.pythonware.com/products/pil/

Here is what it says on the site
If the Windows installer cannot find a Python interpreter, you may have to register ( http://effbot.org/zone/python-register.htm ) your interpreter.

The script looks like this:

Register a Python Interpreter

#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Löw for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm

import sys

from _winreg import *

# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix

regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%sLib\\;%sDLLs\\" % (
    installpath, installpath, installpath
)

def RegisterPy():
    try:
        reg = OpenKey(HKEY_LOCAL_MACHINE, regpath)
    except EnvironmentError:
        try:
            reg = CreateKey(HKEY_LOCAL_MACHINE, regpath)
            SetValue(reg, installkey, REG_SZ, installpath)
            SetValue(reg, pythonkey, REG_SZ, pythonpath)
            CloseKey(reg)
        except:
            print "*** Unable to register!"
            return
        print "--- Python", version, "is now registered!"
        return
    if (QueryValue(reg, installkey) == installpath and
        QueryValue(reg, pythonkey) == pythonpath):
        CloseKey(reg)
        print "=== Python", version, "is already registered!"
        return
    CloseKey(reg)
    print "*** Unable to register!"
    print "*** You probably have another Python installation!"

if __name__ == "__main__":
    RegisterPy()


I could not get this script to register the Python Interpreter so I reinstalled Python.

If there is a better solution, I would like to know what it is.

Joe Bigler

-----Original Message-----
From: Nick Davis [mailto:nd51 at le.ac.uk] 
Sent: Wednesday, August 16, 2006 4:21 AM
To: setup at lists.plone.org
Subject: [Setup] Re: PIL is not installed properly

Joe Bigler wrote:
> Nick,
> 
> Nick,
> 
> Thanks for the help.  I think you identified the problem.  
> 
> If I go to python in my Zope installation and run
> 
> 
>>>>import pil

Joe,
   V glad to have helped you find the problem. However, since I do 
everything on Linux I'm not the best person to ask about install paths 
etc on Windows. Hopefully someone who has done a lot of Zope/Plone on 
Windows will help out.
   It will be something simple like your python path. Sounds like PIL is 
just getting installed with the wrong python.
Regards,
Nick



-- 
Nick Davis
Web Application Developer
University of Leicester
http://www2.le.ac.uk
http://ebulletin.le.ac.uk







More information about the Setup mailing list