Python/Zope chroot issue

5 messages Options
Embed this post
Permalink
Dave Fregon

Python/Zope chroot issue

Reply Threaded More More options
Print post
Permalink
I have python installed in a chroot, zope works fine, Plone as well, but
PIL fails to load in Zope.

in the chroot, I can import not a problem ..

bash-2.05b$ python2.4
Python 2.4.3 (#1, Apr  5 2006, 21:45:50)
[GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Image
>>> from PIL import Image

Anyone have any idea why Zope is showing :

2007-03-29T02:15:07 ERROR Archetypes None
Traceback (most recent call last):
  File "/opt/Plone-2.5.2-1/Archetypes/Field.py", line 2228, in
createScales
    imgdata, format = self.scale(data, w, h)
  File "/opt/Plone-2.5.2-1/Archetypes/Field.py", line 2271, in scale
    image = image.convert('RGBA')
  File "/usr/local/lib/python2.4/site-packages/PIL/Image.py", line 589,
in convert
    self.load()
  File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line
155, in load
    self.load_prepare()
  File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line
221, in load_prepare
    self.im = Image.core.new(self.mode, self.size)
  File "/usr/local/lib/python2.4/site-packages/PIL/Image.py", line 35,
in __getattr__
    raise ImportError("The _imaging C module is not installed")
ImportError: The _imaging C module is not installed

$ ls -la /usr/local/lib/python2.4/site-packages/PIL/_imaging.so

-rwxr-xr-x  6 root root 1645549 Mar 15
23:37 /usr/local/lib/python2.4/site-packages/PIL/_imaging.so

Dave

--
NetAxxs
20 Chisholm St
Wangaratta 3677
Australia
+613 5722 9622

_______________________________________________
Ozzope mailing list
[hidden email]
http://lists.ozzope.org/cgi-bin/mailman/listinfo/ozzope
Tom Dossis

Re: Python/Zope chroot issue

Reply Threaded More More options
Print post
Permalink
Dave Fregon wrote:

> I have python installed in a chroot, zope works fine, Plone as well, but
> PIL fails to load in Zope.
>
> in the chroot, I can import not a problem ..
>
> bash-2.05b$ python2.4
> Python 2.4.3 (#1, Apr  5 2006, 21:45:50)
> [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import Image
>>>> from PIL import Image
>
> Anyone have any idea why Zope is showing :
>
> 2007-03-29T02:15:07 ERROR Archetypes None
> Traceback (most recent call last):
>   File "/opt/Plone-2.5.2-1/Archetypes/Field.py", line 2228, in
> createScales
>     imgdata, format = self.scale(data, w, h)
>   File "/opt/Plone-2.5.2-1/Archetypes/Field.py", line 2271, in scale
>     image = image.convert('RGBA')
>   File "/usr/local/lib/python2.4/site-packages/PIL/Image.py", line 589,
> in convert
>     self.load()
>   File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line
> 155, in load
>     self.load_prepare()
>   File "/usr/local/lib/python2.4/site-packages/PIL/ImageFile.py", line
> 221, in load_prepare
>     self.im = Image.core.new(self.mode, self.size)
>   File "/usr/local/lib/python2.4/site-packages/PIL/Image.py", line 35,
> in __getattr__
>     raise ImportError("The _imaging C module is not installed")
> ImportError: The _imaging C module is not installed
>
> $ ls -la /usr/local/lib/python2.4/site-packages/PIL/_imaging.so
>
> -rwxr-xr-x  6 root root 1645549 Mar 15
> 23:37 /usr/local/lib/python2.4/site-packages/PIL/_imaging.so

Does PIL load from python?

>>> import PIL

_______________________________________________
Ozzope mailing list
[hidden email]
http://lists.ozzope.org/cgi-bin/mailman/listinfo/ozzope
Tom Dossis

Re: Python/Zope chroot issue

Reply Threaded More More options
Print post
Permalink
Tom Dossis wrote:

> Dave Fregon wrote:
>> I have python installed in a chroot, zope works fine, Plone as well, but
>> PIL fails to load in Zope.
>>
>> in the chroot, I can import not a problem ..
>>
>> bash-2.05b$ python2.4
>> Python 2.4.3 (#1, Apr  5 2006, 21:45:50)
>> [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import Image
>>>>> from PIL import Image

> Does PIL load from python?
>
>>>> import PIL

oops - I see you already tried that.
-Tom
_______________________________________________
Ozzope mailing list
[hidden email]
http://lists.ozzope.org/cgi-bin/mailman/listinfo/ozzope
Gus Gollings

Re: Python/Zope chroot issue

Reply Threaded More More options
Print post
Permalink
In reply to this post by Dave Fregon
On 16/05/2007, at 10:34 AM, Dave Fregon wrote:

> I have python installed in a chroot, zope works fine, Plone as  
> well, but
> PIL fails to load in Zope.

I had this problem myself recently, it turned out that I had copied  
across a binary '_imaging.so' from a 64bit platform, and it was  
failing on the destination 32bit platform.

The problem was masked by my PYTHONPATH being different for Zope's  
execution to when running an interactive shell session---I actually  
had two _imaging.so files, each at different points in PYTHONPATH.  
When I ran the interactive python shell, I got the working  
_imaging.so, when Zope ran, it go the broken one.

You might be able to check which _imaging.so you are picking up:

% python -vv -c "import _imaging"

I think I found the problem by doing something like:

% mv /usr/lib/python2.4/site-packages/PIL/_imaging.so /usr/lib/
python2.4/site-packages/PIL/_imaging.sowhat
% python -vv -c "import _imaging"

But YMMV in the chroot.

Regards,

Gus




_______________________________________________
Ozzope mailing list
[hidden email]
http://lists.ozzope.org/cgi-bin/mailman/listinfo/ozzope
Dave Fregon

Re: Python/Zope chroot issue

Reply Threaded More More options
Print post
Permalink
On Wed, 2007-05-16 at 11:01 +1000, Gus Gollings wrote:
> You might be able to check which _imaging.so you are picking up:
>
> % python -vv -c "import _imaging"

Cheers I did this, and found the issue ..

# trying /usr/local/lib/python2.4/site-packages/PIL/_imaging.so
dlopen("/usr/local/lib/python2.4/site-packages/PIL/_imaging.so", 2);
Traceback (most recent call last):
  File "<string>", line 1, in ?
ImportError: libjpeg.so.62: cannot open shared object file: No such file
or directory

I had missed one of the libraries in the chroot :| I rebuilt the chroot
with the file needed, and it's working. yay.

other options folk sent me offlist would have helped too, like
checking :

ldd /usr/local/lib/python2.4/site-packages/PIL/_imaging.so

and making sure all the libraries were found where they should be,

thanks so much for all the replies!

Dave

--
NetAxxs
20 Chisholm St
Wangaratta 3677
Australia
+613 5722 9622

_______________________________________________
Ozzope mailing list
[hidden email]
http://lists.ozzope.org/cgi-bin/mailman/listinfo/ozzope