pygtk install how to

Hi users,

Does anybody know how to install properly pygtk on macosX ? I developped several applications using pygtk and i am asked to make them running on macos and I am completely newbie with this OS.
My best friend google didn't give me interesting links.

I need help.

Thanks

Alex

Another symbol not

Another symbol not found:

thrall:~ gandalf$ cd gtk/inst/lib/pygtk/2.0/
thrall:2.0 gandalf$ python pygtk-demo.py
Traceback (most recent call last):
File "pygtk-demo.py", line 19, in
import gtk
File "/Library/Python/2.5/site-packages/gtk-2.0/gtk/__init__.py", line 48, in
from gtk import _gtk
ImportError: dlopen(/Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so, 2): Symbol not found: _gtk_font_selection_get_face_entry
Referenced from: /Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so
Expected in: flat namespace

thrall:2.0 gandalf$

Thanks in advance for your help !

Symbol not found:

Symbol not found: _gtk_icon_icon_info_load_icon

I followed the above instructions ("jhbuild pygtk") and I think I'm close to have it working, but not quite. It builds and installs just fine, but then I get an error when trying to import the gtk python module:

marc@hyperion:~/gtk-macosx
12:05:50 $ jhbuild build pygtk
Prefix: /Users/marc/gtk/inst
*** Checking out glib *** [1/12]
svn update .
U gio/ChangeLog
U gio/xdgmime/xdgmime.c
Updated to revision 7292.
*** Configuring glib *** [1/12]
...
*** Installing pygtk *** [12/12]
make install
Making install in .
test -z "/Library/Python/2.5/site-packages/gtk-2.0" || /Users/marc/gtk/source/pygtk/install-sh -d "/Library/Python/2.5/site-packages/gtk-2.0"
...
-- Nothing to install
make install-data-hook
*** success *** [12/12]

marc@hyperion:~/gtk-macosx
12:21:40 $ python
Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygtk
>>> pygtk.require('2.0')
>>> import gtk
Traceback (most recent call last):
File "", line 1, in
File "/Library/Python/2.5/site-packages/gtk-2.0/gtk/__init__.py", line 48, in
from gtk import _gtk
ImportError: dlopen(/Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so, 2): Symbol not found: _gtk_icon_icon_info_load_icon
Referenced from: /Users/marc/gtk/inst/lib/libgtk-quartz-2.0.0.dylib
Expected in: flat namespace

Thanks for all the work on this! This looks fantastic and I'm looking forward to getting it working and having a native version of my app.

-Marc
http://marc-abramowitz.com

I believe that is fixed in

I believe that is fixed in svn trunk since last night, please try again :)

Tried again. That problem

Tried again. That problem went away :-) but now there's a new one :-(

ImportError: dlopen(/Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so, 2): Symbol not found: _gdk_screen_get_monitor_height_mm

-Marc

Seems like there are some

Seems like there are some unimplemented new functions that need implementing. I'll try to do that asap, can't promise when though. Thanks for reporting.

I added three missing

I added three missing symbols. Please let me know if you have more issues.

Thanks, Richard! Now I'm

Thanks, Richard!

Now I'm getting:

ImportError: dlopen(/Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so, 2): Symbol not found: _gtk_clipboard_wait_is_uris_available

This time it also had trouble building Pango (which I told it to ignore though this will probably impact me later as my app uses some Pango markup):

checking for CAIRO... no
no
configure: error: *** Could not enable any of FreeType, X11, Cairo, or Win32 backends.
*** Must have at least one backend to build Pango.
make: *** [config.status] Error 1

and I had trouble with the following command which used to work:

$ jhbuild pygtk
Prefix: /Users/marc/gtk/inst
jhbuild pygtk: command not found

OK, two more missing symbols

OK, two more missing symbols added. The question is why I can use the pygtk bindings with those symbols missing. Is this on 10.4 or .5? And with an up to date jhbuild setup as described here?

Hi, I am trying to get pygtk

Hi, I am trying to get pygtk running on macosX 10.5.4 Leopard. I downloaded and installed gtk and pygtk using jhbuld yesterday, but I still get the following error when trying to run the application I need that calls them.

%seatree
Traceback (most recent call last):
File "/Users/seismodoc/progs/src/seatree-0.1.1-031308/install/../py-drivers/py-gui/SEATREE.py", line 5, in
import gtk, sys, signal, traceback, os, shutil
File "/Library/Python/2.5/site-packages/gtk-2.0/gtk/__init__.py", line 48, in
from gtk import _gtk
ImportError: dlopen(/Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so, 2): Symbol not found: _gtk_clipboard_wait_is_uris_available
Referenced from: /Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so
Expected in: flat namespace

It should work now that you added the symbols, right?

I had missed that particular

I had missed that particular symbol, added now. Thanks! I really wonder why I can't see those, I can always import gtk.

Thanks, that error went

Thanks, that error went away, but now I have a new one that seems to be the same as the one mentioned at the top of this thread so it should be fixed. weird.

from gtk import _gtk
ImportError: dlopen(/Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so, 2): Symbol not found: _gtk_font_selection_get_face_entry
Referenced from: /Library/Python/2.5/site-packages/gtk-2.0/gtk/_gtk.so
Expected in: flat namespace

As I replied to that one,

As I replied to that one, "that symbol is not supposed to be in there, you need to rebuild the pygtk module (make sure to clean it before rebuilding)."

If you find more of those symbol issues, just mail me instead, that is easier (richard a t imendio.com).

That symbol is not supposed

That symbol is not supposed to be in there, you need to rebuild the pygtk module (make sure to clean it before rebuilding).

GIMP uses pygtk. Since the

GIMP uses pygtk. Since the jhbuild script can install GIMP (i think) it should also be able to install pygtk. Alternatively, look at the GIMP wiki, some time ago I wrote an article on building GIMP on mac (http://wiki.gimp.org/gimp/HowToCompileGimp/MacOSX), and this article includes pygtk

Getting it to run will be rather easy, packaging it will be much harder

Yeah, you can use the setup

Yeah, you can use the setup described on this site, and then run

jhbuild build meta-gtk-osx-python

As Auria says, packaging is harder :) I have some plans to add pygtk support to the app bundler also on this site.

Richard: don't you think

Richard: don't you think making some sort of "official" GTK installer for mac would help? We could simply let an installer stage it in some standard location (like a .framework, or just leaving it in /opt), and apps can then just link to it without caring about packaging (and ask their users to run the GTK installer - just like it's done on windows)

that would save a heck of time and be so much more simple

We are working on a

We are working on a framework that people can just download and use.
/Richard

great job :D thanks for the

great job :D thanks for the amazing work.

osx - how to install pygtk

osx - how to install pygtk :

Hi

can you suggest me the procedure
to have pygtk installed on OSX 10.5.3 ?

already i've followed the superb "jhbuild procedure" to install gtk+
it terminate the process without errors,
so now i've a full gtk environment (i think) :-D thanks to the developpers!!!

now to install pygtk, googling suggest me to install :
pygobject-2.14.2
and
pygtk (svn version)

cd pygobject-2.14.2
./configure PKG_CONFIG=/Users/sasha/gtk/inst/bin/pkg-config
make
sudo make install

the build process is terminated without errors

... tring to install pygtk
it need some works to export the right GTK environment libraries
(libtool, automake, pkg-config ..)
infact tring to run autogen it fail with these error :

sashas-macbook-pro-15:pygtk sasha$ sh autogen.sh

checking for autoconf >= 2.53...

testing autoconf2.50...
not found.
testing autoconf...
found 2.61

checking for automake >= 1.8...

testing automake-1.8...
not found.
testing automake-1.9...
not found.
testing automake-1.10...
found 1.10

checking for libtool >= 1.4.3...

testing libtoolize...
not found.
***Error***: You must have libtool >= 1.4.3 installed
to build PyGTK. Download the appropriate package for
from your distribution or get the source tarball at
http://ftp.gnu.org/pub/gnu/libtool/libtool-1.4.3.tar.gz

using /Users/sasha/gtk/inst/bin/pkg-config for pkg-config

Checking for required M4 macros...

pkg.m4 not found

Checking for forbidden M4 macros...

***Error***: some autoconf macros required to build PyGTK
were not found in your aclocal path, or some forbidden
macros were found. Perhaps you need to adjust your
ACLOCAL_FLAGS?

Thanks for any help!

Massimo

Associazione Italiana per l'Informazione Geografica Libera
- GFOSS.IT - www.gfoss.it
[Geographic Free and Open Source Software]

It's much easier than that.

It's much easier than that. Use the instructions here on building GTK+. When that is done, just do the following:

jhbuild build pygtk

yep :-D ..it works fine

yep :-D

..it works fine !!!

i first get an error about permission denied
at the make install (pygobject) process
(i'm using the leopard system python that requires sudo privileges)
i used "sudo jhbuild build pygtk"
... i tested the pygtk hello-world example
and everithing works fine :-D

really thanks to all!

Associazione Italiana per l'Informazione Geografica Libera
- GFOSS.IT - www.gfoss.it
[Geographic Free and Open Source Software]