3

I am having difficulty on my server trying to get the selftest.py to run successfully.

I am trying to get PIL 1.1.7 working with Python 2.4.4 (Are the versions compatible?)

When the install is preformed like so:

# python2.4 setup.py install
running install
running build
running build_py
running build_ext
--------------------------------------------------------------------
PIL 1.1.7 SETUP SUMMARY
--------------------------------------------------------------------
version       1.1.7
platform      linux2 2.4.6 (#1, Dec 21 2012, 14:54:30)
              [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]
--------------------------------------------------------------------
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support 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.
running build_scripts
running install_lib
running install_scripts
changing mode of /usr/local/bin/pilconvert.py to 755
changing mode of /usr/local/bin/pilprint.py to 755
changing mode of /usr/local/bin/pilfile.py to 755
changing mode of /usr/local/bin/pilfont.py to 755
changing mode of /usr/local/bin/pildriver.py to 755
creating /usr/local/lib/python2.4/site-packages/PIL.pth

Everything seems handy dandy. Jpeg support is available and all is happy. But the selftest.py however is a different story:

 # python2.4 /usr/local/src/Imaging-1.1.7/selftest.py
 --------------------------------------------------------------------
 PIL 1.1.7 TEST SUMMARY rc/Imaging-1.1.7]# yum install libjpeg62-devel zlib1g-devel       libfreetype6-devel liblcms1-develp
 --------------------------------------------------------------------
 Python modules loaded from ./PIL
 Binary modules loaded from ./PIL
 --------------------------------------------------------------------
 --- PIL CORE support ok
 *** TKINTER support not installed
 *** JPEG support not installed
 *** ZLIB (PNG/ZIP) support not installed
 --- FREETYPE2 support ok
 *** LITTLECMS support not installed
 --------------------------------------------------------------------
 Running selftest:
 *****************************************************************
 Failure in example:
 try:
  _info(Image.open(os.path.join(ROOT, "Images/lena.jpg")))
 except IOError, v:
  print v
 from line #24 of selftest.testimage
 Expected: ('JPEG', 'RGB', (128, 128))
 Got: decoder jpeg not available
 1 items had failures:
    1 of  57 in selftest.testimage
     ***Test Failed*** 1 failures.
     *** 1 tests of 57 failed.

I get the dreaded Jpeg decoder not available.

I've tried a variety of things. I changed the setup to point to usr/lib64 that didn't work. I made some symbolic links in the usr/lib to point to the libjpeg.so file, that also didn't work. I went back and forth with the tech guys at our server hosting place and they aren't understanding the issue and it's like talking to a wall. I am really stuck. The only thing I haven't tried is the PiP but I didn't try that because I don't know how that works exactly. So I want to avoid that.

Is there a compatibility issue or a setting I just don't have quite right?

Thank you for the assistance.

--UPDATE--

Working on this problem again these days I've tested Centos 5 & 6 32-bit And everything installs like a charm, but 64-bit I'm still having issues.

It seems like the selftest works with the stock python2.6 but not with python2.4. Pil 1.1.7 is compatable with 2.4.4 but I think there is a problem with the libraries in 64-bit. Still searching for a solution.

Mallow
  • 764
  • 1
  • 11
  • 33
  • "(Are the versions compatible?)" Looking at the [PIL Homepage](http://www.pythonware.com/products/pil/), I see a download link specifically for 2.4. Is that the version you installed? Edit: oops, that's windows only, so I guess not. but at least that indicates that it's _possible_ to run on 2.4. – Kevin Feb 07 '13 at 21:06

3 Answers3

0

After extensive testing it's just not possible.

I'm sure it can be done but the steps it would require to get it down would be so intensive that it would make it difficult to gaurentee the stability of the server/system.

The problem really lies in the 64-bit system. The Python-Imagining would work with python 2.4 if python 2.4 was compiled as 32-bit. However even if you get Python-2.4 compiled into 32-bit it has a hard time with the libraries since everything in Centos is build for the 64 arch. And getting those additional libraries is cumbersome since the repos won't include the structures you need to get it working. It's just, annoying. It's not feasible to go hunting around in circles and the time spent trying to support such a limping system is wasted. And possibly puts the system at risk.

No, it's not possible to install PIL for Python 2.4 on a 64-bit machine.

Mallow
  • 764
  • 1
  • 11
  • 33
0

In my case we had no support of all the libraries in PIL (CentOS 6, x64)

*** TKINTER support not available
*** JPEG support not available
--- ZLIB (PNG/ZIP) support available
*** FREETYPE2 support not available
*** LITTLECMS support not available

So we used following:

yum install freetype freetype-devel libpng libpng-devel libjpeg libjpeg-devel

And now we have

*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
profuel
  • 118
  • 5
  • Which version of python did you use to do the PIL Selftest? That's the kicker, of course you can get PIL to work on 64-bit, but can you get PIL to work with python 2.4 on the 64-bit. – Mallow Aug 28 '13 at 03:13
  • 1
    sorry, but using 2.4 is not suitable for us, so maybe that's the point – profuel Oct 02 '13 at 14:39
0

3 years later, I know, but this can work just fine! The standard build process will not look for libraries in /usr/lib64, but you can't specify a library path when running setup.py build, so you need to rebuild the binaries afterwards in a separate step:

yum install freetype-devel libpng-devel libjpeg-turbo-devel libzip-devel lcms-devel
pip download PIL
unzip pil-1.1.7.zip
cd pil-1.1.7
./setup.py build
./setup.py build_ext -L /usr/lib64/:/usr/local/lib64 --force
./setup.py install --prefix /usr/local/python27 --force --skip-build

This is on Scientific Linux 6.7 64-bit, using Python 2.7 compiled from source.

miken32
  • 35,483
  • 13
  • 81
  • 108