Python and GTK-OSX

Felix Krause <[email protected]> Fri, 2 Dec 2011 23:21:33 +0100
Newsgroups gmane.comp.ide.gps.devel
Message-ID <[email protected]>
--===============0812717058==
Content-Type: multipart/signed;
	boundary="Apple-Mail=_51804D69-503D-4617-8D92-D19AED9B88F9";
	protocol="application/pgp-signature"; micalg=pgp-sha1


--Apple-Mail=_51804D69-503D-4617-8D92-D19AED9B88F9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hi everyone,

I'm trying to compile GPS and link it against GTK-OSX =
(http://live.gnome.org/GTK%2B/OSX/Building), which provides a more =
native interface on MacOSX. So far, I succeeded in compiling the binary, =
but when I try to start it, it always fails to initialize Python (I =
linked against the Python framework that comes with MacOSX Lion). My =
first attempt looked like this:

$ ~/gtk/inst/bin/gps

Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
ImportError: No module named site

I guess the Gtk-WARNING can be ignored for now. The problem here is that =
Python does not know the directory where its modules are located. So I =
did:

$ export =
PYTHONPATH=3D/System/Library/Frameworks/Python.framework/Versions/2.7/lib/=
python2.7 =20
$ ~/gtk/inst/bin/gps                                                     =
                =20

Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale.
Traceback (most recent call last):
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/si=
te.py", line 555, in <module>
    main()
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/si=
te.py", line 537, in main
    known_paths =3D addusersitepackages(known_paths)
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/si=
te.py", line 268, in addusersitepackages
    user_site =3D getusersitepackages()
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/si=
te.py", line 243, in getusersitepackages
    user_base =3D getuserbase() # this will also set USER_BASE
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/si=
te.py", line 233, in getuserbase
    USER_BASE =3D get_config_var('userbase')
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sy=
sconfig.py", line 523, in get_config_var
    return get_config_vars().get(name)
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sy=
sconfig.py", line 419, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File =
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sy=
sconfig.py", line 287, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open =
/Users/Felix/gtk/inst/lib/python2.7/config/Makefile (No such file or =
directory)

While Python does find its modules now, it still fails to load its =
configuration files. I tried to set the other python environment =
variables (PYTHONHOME, PYTHONFRAMEWORK, PYTHONBASE) to the corresponding =
places in the framework, but nothing changed. Python looks for its =
configuration in the installation prefix of GTK-OSX, where the GPS =
binary lies, instead of using the system's Python installation. I cannot =
tell whether this problem originates on the Python side or on the GPS =
side. Does anyone have advice?

Btw, I currently use GPS revision 177042, as this is the first revision =
I found that I succeeded to compile (with some modifications to the =
build system). I didn't have luck with the release version 5.0.1, nor =
with newer svn revisions.

Cheers,
Felix=

--Apple-Mail=_51804D69-503D-4617-8D92-D19AED9B88F9
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJO2U9tAAoJEHIAd3aBFan/EQ8H/ivzXi33E+se5zQai0zouiEP
pz+Q8zRK3yERyZcP6gNOcbhUvcj6aS0CP+0Z2vvG4PC3km/cVMD566tSDTNYYZad
9Lty/QC0YVCh/BL8pqS5XaR5lsjWfO0uqiuGRWOiR4Sce0Vk5+H7DEVoH5CHY7Se
wOOTP69dK45MnarXIRIafOEad1CLa0HzcX2y+W2I/EBUD/1LQv/G1t/QBBvNPUtJ
uwdc+rekxMpr1rydLgTSbMnVFJqU9WrHepXdyKRwIEqExw4QJWxT4w7kasJV/Nx7
IgD6rGCyz+lgdPAATo0K+iDKNkAHm2tQsrJ1FkVYk040wn0OxWORvzfLsBHwYFg=
=fmZE
-----END PGP SIGNATURE-----

--Apple-Mail=_51804D69-503D-4617-8D92-D19AED9B88F9--

--===============0812717058==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gps-devel mailing list
[email protected]
http://lists.adacore.com/mailman/listinfo/gps-devel

--===============0812717058==--