pygtk needs python 2.5?
Submitted by mtcccom on Thu, 2008-06-05 22:16.
hi all,
I'm trying to get pygtk running, and it's failing in
pycairo saying that it needs python >= 2.5. What's rather
curious is that the build process drags in python 2.4 itself
so is it really the case that I need create yet another
python build? And if so, are there special requirements
when building? Ie, is the only thing I need to do to make
this work is create a 2.5 version of python and have the
build process find that, or are there other dependencies
that will make loading pygtk apps up difficult if it's
not installed in the usual places?
thx, Mike

The 2.5 requirement seems to
The 2.5 requirement seems to be pretty newly added, I don't know why it was done as the changelog doesn't say so. Maybe you could file a bug for that or ask the maintainer?
It should work to install 2.5 manually and get that picked up, but it would be better if 2.4 could be used...
Hi again, So it looks like
Hi again,
So it looks like the changes have mostly to do with py_ssize_t
which I guess is a difference between 2.4 and 2.5. It looks like a py_ssize_t in 2.4 was just an int. I fixed these up to
be an int again and recompiled and it seems to be working with 2.4. I agree that it would be nice if there were some backward
compatibility and this doesn't appear to be too big a hardship.
Who is the maintainer, and how do I contact them?
Michael Thomas, SF, CA
Yeah, I get this same error
Yeah, I get this same error during "jhbuild build meta-gtk-osx-python". Can I make the earlier jhbuild steps build python 2.5 instead? Which ~/.jhbuild/ file(s) do I need to edit?
checking for a Python interpreter with version >= 2.5... none
configure: error: no suitable Python interpreter found
*** error during stage configure of pycairo: ########## Error running ./autogen.sh --prefix /Users/raymont/gtk/inst --libdir '${exec_prefix}/lib' --disable-static --disable-gtk-doc --disable-docs --disable-scrollkeeper *** [3/11]
After skipping this module, I got another error later:
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: multiple definitions of symbol __PyGObject_API
.libs/_gio_la-giomodule.o private external definition of __PyGObject_API in section (__DATA,__common)
.libs/_gio_la-pygio-utils.o private external definition of __PyGObject_API in section (__DATA,__common)
collect2: ld returned 1 exit status
make[2]: *** [_gio.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** error during stage build of pygobject: ########## Error running make *** [5/11]
*** module pygtk not built due to non buildable pygobject *** [10/11]
*** module pygtk not built due to non buildable pycairo *** [10/11]
*** module meta-gtk-osx-python not built due to non buildable pycairo *** [11/11]
*** module meta-gtk-osx-python not built due to non buildable pygobject *** [11/11]
*** module meta-gtk-osx-python not built due to non buildable pygtk *** [11/11]
*** the following modules were not built *** [11/11]
If you have a recent version
If you have a recent version of jhbuild and the setup described in the build instructions, python 2.5 should already be built if you are on tiger. If you are on leopard, python 2.5 is already part of the system.
If that is not working, we need to debug. Start by rerunning the setup script, then try again (including the bootstrap), if it doesn't work I need to know what OS version you have,
what those commands say:
/usr/bin/python --version
which python
jhbuild run sh -c "echo \$PYTHON"
md5 $HOME/.jhbuildrc-custom
I'm on 10.4. I downloaded
I'm on 10.4. I downloaded the gtk-osx-build-setup.sh script on July 12. I see python 2.4 during "jhbuild build".
...
checking for python... /Users/raymond/gtk/inst/bin/python
checking for python version... 2.4
checking for python platform... darwin
checking for python script directory... ${prefix}/lib/python2.4/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.4/site-packages
checking for iconv_open... no
checking for libiconv_open in -liconv... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking whether we are using the GNU C Library 2.1 or newer... no
checking Whether to cache iconv descriptors... yes
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
...
find gtk/ -name python
gtk//inst/bin/python
gtk//source/ige-mac-integration-0.8.2/bindings/python
gtk//source/waf-1.4.2/demos/python
ls -al gtk/inst/bin/ | grep python
-rwxr-xr-x 2 raymond raymond 3471916 Jul 16 17:59 python
-rwxr-xr-x 2 raymond raymond 3471916 Jul 16 17:59 python2.4
/usr/bin/python --version
Unknown option: --
usage: /usr/bin/python [option] ... [-c cmd | file | -] [arg] ...
Try `python -h' for more information.
which python
/usr/bin/python
/usr/bin/python -h
...
Python 2.3.5 (#1, Dec 7 2006, 14:50:51)
[GCC 4.0.1 (Apple Computer, Inc. build 5363) (+4864187)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
jhbuild run sh -c "echo \$PYTHON"
Prefix: /Users/raymond/gtk/inst
md5 $HOME/.jhbuildrc-custom
MD5 (/Users/raymond/.jhbuildrc-custom) = 343a6c34201ede31eb7a69935920914d
OK, thanks. Did you run
OK, thanks. Did you run "jhbuild bootstrap" after updating the script? (That's the part that builds python if necessary).
What does "uname -a" say?
Also, you can try to debug your ~/.jhbuildrc with some print statements to see why jhbuild is not being built (search for python in it).
10.4 (darwin 8) is detected
10.4 (darwin 8) is detected fine. I think the problem is "jhbuild bootstrap" builds python 2.4.5 instead of 2.5:
...
[1m*** Checking out python *** [10/13][0;10m
[1m*** Configuring python *** [10/13][0;10m
...
[1m*** Building python *** [10/13][0;10m
...
/usr/bin/gcc-4.0 -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -I. -I/Users/raymond/gtk/source/Python-2.4.5/./Include -I/Users/raymond/gtk/source/Python-2.4.5/./Mac/Include -I/Users/raymond/gtk/inst/include -I/usr/local/include -I/Users/raymond/gtk/source/Python-2.4.5/Include -I/Users/raymond/gtk/source/Python-2.4.5 -c /Users/raymond/gtk/source/Python-2.4.5/Modules/readline.c -o build/temp.macosx-10.3-i386-2.4/readline.o
/Users/raymond/gtk/source/Python-2.4.5/Modules/readline.c: In function 'write_history_file':
/Users/raymond/gtk/source/Python-2.4.5/Modules/readline.c:120: warning: implicit declaration of function 'history_truncate_file'
ls -al ~/gtk/source/pkgs
total 73320
drwxr-xr-x 26 raymond raymond 884 Jul 15 17:21 .
drwxr-xr-x 38 raymond raymond 1292 Jul 15 18:54 ..
-rw-r--r-- 1 raymond raymond 734954 Nov 29 2004 PyXML-0.8.4.tar.gz
-rw-r--r-- 1 raymond raymond 8159705 Mar 12 15:26 Python-2.4.5.tar.bz2
-rw-r--r-- 1 raymond raymond 229689 Aug 18 2003 XML-Parser-2.34.tar.gz
-rw-r--r-- 1 raymond raymond 71129 Aug 15 2007 XML-Simple-2.18.tar.gz
-rw-r--r-- 1 raymond raymond 1042439 Jul 14 00:16 autoconf-2.61.tar.bz2
-rw-r--r-- 1 raymond raymond 918341 Jul 14 00:18 automake-1.10.1.tar.bz2
-rw-r--r-- 1 raymond raymond 375060 Jul 14 00:17 automake-1.4-p6.tar.gz
-rw-r--r-- 1 raymond raymond 577705 Jul 14 00:18 automake-1.7.9.tar.bz2
-rw-r--r-- 1 raymond raymond 663182 Jul 14 00:18 automake-1.8.5.tar.bz2
-rw-r--r-- 1 raymond raymond 765505 Jul 14 00:18 automake-1.9.6.tar.bz2
-rw-r--r-- 1 raymond raymond 5241874 Apr 21 03:45 cairo-1.6.5-20080421-a2c4fd.tar.gz
-rw-r--r-- 1 raymond raymond 1933641 May 3 07:17 docbook-setup-3.tar.gz
-rw-r--r-- 1 raymond raymond 450860 Jan 11 2006 expat-2.0.0.tar.gz
-rw-r--r-- 1 raymond raymond 8546162 Jul 14 00:10 gettext-0.16.tar.gz
-rw-r--r-- 1 raymond raymond 16566 May 3 07:13 gnome-doc-utils-fake-2.tar.gz
-rw-r--r-- 1 raymond raymond 33616 Nov 22 2006 hicolor-icon-theme-0.10.tar.gz
-rw-r--r-- 1 raymond raymond 374304 May 18 11:04 ige-mac-integration-0.8.2.tar.gz
-rw-r--r-- 1 raymond raymond 613261 Jul 15 17:20 jpegsrc.v6b.tar.gz
-rw-r--r-- 1 raymond raymond 624606 May 8 08:03 libpng-1.2.29.tar.bz2
-rw-r--r-- 1 raymond raymond 2961939 Jul 14 00:16 libtool-1.5.26.tar.gz
-rw-r--r-- 1 raymond raymond 411817 Mar 27 10:18 pixman-0.10.0.tar.gz
-rw-r--r-- 1 raymond raymond 1032839 Jan 16 2008 pkg-config-0.23.tar.gz
-rw-r--r-- 1 raymond raymond 1336295 Jul 15 17:21 tiff-3.8.2.tar.gz
-rw-r--r-- 1 raymond raymond 360861 Jul 14 00:24 waf-1.4.2.tar.bz2
I substituted python 2.5.2
I substituted python 2.5.2 in place of 2.4.5, to fool "jhbuild bootstrap" into building that instead. This gets "jhbuild build meta-gtk-osx-python" past pycairo's python-2.5 check (step 3/11), but pyobject (step 5/11) still fails at the same place:
generating symbol list for `_gio.la'
/usr/bin/nm -p .libs/_gio_la-giomodule.o .libs/_gio_la-pygio-utils.o .libs/_gio_la-gio.o | sed -n -e 's/^.*[ ]\([BCDEGRST][BCDEGRST]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | /usr/bin/sed 's/.* //' | sort | uniq > .libs/_gio.exp
/usr/bin/grep -E -e "init_gio" ".libs/_gio.exp" > ".libs/_gio.expT"
mv -f ".libs/_gio.expT" ".libs/_gio.exp"
sed -e 's,^,_,' < .libs/_gio.exp > .libs/_gio-symbols.expsym
gcc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/_gio.so -bundle .libs/_gio_la-giomodule.o .libs/_gio_la-pygio-utils.o .libs/_gio_la-gio.o -L/Users/raymond/gtk/inst/lib /Users/raymond/gtk/inst/lib/libgio-2.0.dylib /usr/lib/libiconv.dylib /usr/lib/libc.dylib /Users/raymond/gtk/inst/lib/libgobject-2.0.dylib /Users/raymond/gtk/inst/lib/libgmodule-2.0.dylib /Users/raymond/gtk/inst/lib/libglib-2.0.dylib /Users/raymond/gtk/inst/lib/libintl.dylib -Wl,-headerpad_max_install_names -Wl,-exported_symbols_list,.libs/_gio-symbols.expsym
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: multiple definitions of symbol __PyGObject_API
.libs/_gio_la-giomodule.o private external definition of __PyGObject_API in section (__DATA,__common)
.libs/_gio_la-pygio-utils.o private external definition of __PyGObject_API in section (__DATA,__common)
collect2: ld returned 1 exit status
make[2]: *** [_gio.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** error during stage build of pygobject: ########## Error running make *** [5/11]
Ah! Good catch, I was
Ah! Good catch, I was thinking tiger had 2.4... :) Thanks for looking into this.
I have committed a change that makes the moduleset use pycairo 1.4.12 that works with python 2.4. The second problem is due to a recent addition to pygobject, I will talk to the maintainer to see how it can be fixed.
SVN works now, please try
SVN works now, please try again (rebuild pycairo too).