Re: [gtk-osx-devel] [gtk-osx-users] gtk-mac-bundler: Unable to load image-loading module ...
- From: John Ralls <jralls ceridwen us>
- To: Christophe <cch heonium com>
- Cc: "gtk-osx-devel-list gnome org" <gtk-osx-devel-list gnome org>
- Subject: Re: [gtk-osx-devel] [gtk-osx-users] gtk-mac-bundler: Unable to load image-loading module ...
- Date: Tue, 12 Feb 2013 13:29:34 -0800
On Feb 12, 2013, at 8:37 AM, Christophe <cch heonium com> wrote:
> Le Tuesday 29 Jan 2013 à 11:28:22 (-0800), John Ralls a écrit :
>>
>> On Jan 29, 2013, at 10:02 AM, Christophe <cch heonium com> wrote:
>>
>>> Le Tuesday 29 Jan 2013 à 08:49:39 (-0800), John Ralls a écrit :
>>>>
>>>> On Jan 29, 2013, at 7:32 AM, Christophe <cch heonium com> wrote:
>>>>
>>>>> Le Tuesday 29 Jan 2013 à 06:55:40 (-0800), John Ralls a écrit :
>>>>>>
>>>>>> On Jan 29, 2013, at 4:53 AM, Christophe <cch heonium com> wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I am new to gtk-mac-bundler, and it seems to have followed the
>>>>>>> documentation to the letter but when I run the generated
>>>>>>> package i have the following error message:
>>>>>>>
>>>>>>> CRITICAL:init:Unable to load image-loading module: @executable_path/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so: dlopen(@executable_path/../Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so,1): image not found
>>>>>>>
>>>>>>> I specify the image file it tries to open is present in bunble. I
>>>>>>> googling for several days but I have not found anything relevant.
>>>>>>> Can you give a link or a track to solve this problem
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Assuming you've checked the bundle to ensure that libpixbufloader-png.so is in fact in that path, the usual cause of this problem is attempting to run an auxiliary program from Contents/Resources/bin instead of Contents/MacOS. @executable_path starts from the path of the binary that starts the linker-chain.
>>>>>>
>>>>> Ok I understand, but I followed the sample: 'pygtk-demo' and I set the
>>>>> entry 'launcher_script' which copied the script in the 'Contents/MacOS'.
>>>>> This script calls the python script in the same directory which starts
>>>>> the application that it is in 'Contents/Resources/bin'. The only
>>>>> difference is that in this sample the final script is in
>>>>> 'Contents/Resources/lib/pygtk/2.0'.
>>>>> You advise me to the Python application being in 'Contents/Resources/bin'
>>>>> in 'Contents/MacOS'? In this case i need to modify a lot a things in the
>>>>> application.
>>>>>
>>>>
>>>> So this is python. That changes things a bit.
>>>> The location of the python script doesn't matter, the executable (as far as the linker and dlopen are concerned) is the python interpreter, which is why it is in Contents/MacOS.
>>>>
>>>> If you shell out to another program, though, (os.spawn, popen2, subprocess.call, etc.), that creates a new executable for linking and loading, and the easiest thing to do is to put any program that you need in Contents/MacOS as well.
>>>
>>> I have put python interpreter and the python script in the bundle
>>> (Contents/MacOS) but i have exactly the same error when i try to run it.
>>
>> It appears that you *don't* understand. So long as you stay in the python script, python is the executable, the location of the script isn't important. That's they way pygtk-demo works -- and it does work, I just tested it. So either you've screwed something up in converting the example to your script or your script is calling another program which isn't in Contents/MacOS.
>>
>> You have to figure out which is the problem, I can't without reviewing your code, and I'm not interested in doing that.
>
> Hello
>
> I understand that you do not want to see my code and I do not ask you,
> however i did a little test from 'pygtkdemo' and I'd like your opinion.
>
> I add the following line to the file ~/gtk/inst/lib/pygtk/2.0/pygtk-demo.py ':
>
> ...
> import gdk
> ...
> Gtk.gdk.pixbuf_new_from_file ICON = ('/Users/gtkosx3/Desktop/PyGtkDemo.app/Contents/MacOS/icon.png')
> ...
>
> and the following lines in the file 'pygtk-demo.bundle':
>
> ...
> <!-- <binary Dest="${bundle}/Contents/MacOS">
> ${prefix}/bin/python
> </binary> -->
> <binary dest="${bundle}/Contents/MacOS">
> /usr/bin/python
> </binary>
> <binary dest="${bundle}/Contents/MacOS">
> /usr/bin/python2.7
> </binary>
> ....
> <binary>
> ${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*. *
> </ binary>
> ...
>
> I run the bundle generation and when I excute it I still have the same
> error message. I do not see how I can know what is called external
> library.
>
> Thank you for your time and your answer.
Please keep this on the list.
I don't think that putting the Apple-supplied python in the bundle is going to work. When I try that I get
Fatal Python error: PyThreadState_Get: no current thread
Desktop/PyGtkDemo.app/Contents/MacOS/PyGtkDemo: line 65: 26075 Abort trap: 6 $EXEC $PYTHON "$bundle_contents/MacOS/pygtk-demo"
But perhaps that's because PyGtk is built with ${prefix}/bin/python. It's much cleaner to do it that way as well.
So after fixing that and your mistakes in selecting the loaders and the syntax errors and all of that, it loads up just fine.
Regards,
John Ralls
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]