PIL selftest.py not working for Centos 6 64 bit error: Jpeg decoder not available

My server is having difficulty trying to run selftest.py.

I'm trying to get PIL 1.1.7 working with Python 2.4.4 (are versions compatible?)

When the installation is done like this:

# 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 comfortable dandy. Jpeg support is available and everyone is happy. However, selftest.py is a completely 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 am getting a terrible Jpeg decoder not available.

I've tried different things. I changed the setting to point to usr / lib64 which didn't work. I made some symbolic links in usr / lib to point to the libjpeg.so file which also didn't work. I went back and forth with the tech guys on our hosting server and they don't understand the problem and it's like talking to the wall. I am really stuck. The only thing I haven't tried is PiP, but I haven't done it because I don't know how it works. So I want to avoid it.

Is there a compatibility issue or a setting that I'm just not quite right?

Thanks for the help.

- UPDATE -

Working on this issue again these days I have tested Centos 5 and 6 32-bit. And everything installs like a charm, but with 64-bit I still have problems.

Selftest seems to work with python2.6 stock, but not python2.4. Pil 1.1.7 is compatible with 2.4.4, but I think there is a problem with the libraries in 64-bit. Keep looking for a solution.

+3


source to share


3 answers


After extensive testing, this is simply not possible.

I'm sure it can be done, but the steps it will take to fix it will be so intense that it will make it difficult to gaurentee server / system stability.



The problem is in the 64-bit system. Python-Imagining will work with python 2.4 if python 2.4 was compiled as 32-bit. However, even if you get Python-2.4 compiled to 32-bit, it has a hard time working with libraries as everything in Centos is built for the 64-arch. And getting these additional libraries is cumbersome as the repositories won't include the structures it needs to work. It's just annoying. It is impossible to go hunting in circles and the time spent maintaining such a chrome plating system is wasted. And the system may be at risk.

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

0


source


In my case, we did not have support for all 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 the 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

      

0


source


3 years later, I know, but it might work just fine! The standard build process will not look for libraries in /usr/lib64

, but you cannot specify the path to the library at startup setup.py build

, so you need to rebuild the binaries in a separate step later:

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.

0


source







All Articles