[gps-devel] Python and GTK-OSX
Felix Krause
flyx at isobeef.org
Fri Dec 2 23:21:33 CET 2011
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=/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
$ ~/gtk/inst/bin/gps
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/site.py", line 555, in <module>
main()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 537, in main
known_paths = addusersitepackages(known_paths)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 268, in addusersitepackages
user_site = getusersitepackages()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 233, in getuserbase
USER_BASE = get_config_var('userbase')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.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/sysconfig.py", line 419, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : /pipermail/gps-devel/attachments/20111202/688f7ace/attachment.pgp
More information about the gps-devel
mailing list