Is there a binary out there for the current mac os x, python for PyGTK? I work with multiple desktop environments (mac, windows, gnome) and really consider python's lack of cross platform GUI's a problem. Does anyone know where I can find a built version of PyGTK and GTK for Mac? I cant clone the git repository, it keeps timing out.
问题:
回答1:
I don't use macports but it seems that jhbuild works for me. Below is the steps that I've done.
- download gtk-osx-build-setup.sh from:
https://raw.github.com/jralls/gtk-osx-build/master/gtk-osx-build-setup.shand save it to your home directory. - fire up terminal and navigate to your home directory and run the command
sh gtk-osx-build-setup.sh - the shell script will warn you that
~/.local/binisn't added to your environment variable to do this, edit your.profilefile located at your home directory and/Users/to your environment variable. to know more on how to edit this file check out:/.local/bin http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/ - after that, do a
~/.local/bin/jhbuild bootstrapcommand. it will download and install some necessary utilities. - download and install the beta version of the gtk+ osx framework at:
http://ftp.imendio.com/pub/imendio/gtk-osx/Gtk-Framework-2.14-LATEST.dmg - before installing the
meta-gtk-osx-python, you need to build and install some other packages thatjhbuilddoesn't install automatically, so what i did was i installedlibpngby doing the command:~/.local/bin/jhbuild build libpng - you also need to install
libtiffso do the command:~/.local/bin/jhbuild build libtiff - and also
gtk-docis needed so:~/.local/bin/jhbuild build gtk-doc - and finally you can now install
meta-gtk-osx-pythonby doing a:~/.local/bin/jhbuild build meta-gtk-osx-python
Let me know if it works.
回答2:
brew install pygtk worked for me (requires homebrew).
Confirmed to work with OS X 10.10 too, but by default it will install it into brew's Python distribution, so if you are still using the native python, it will not find it.
回答3:
There is an installer for PyGTK 2.24 in test here, announced on the PyGTK list.
UPDATE project has moved on macpkg's sourceforge page.
I couldn't make it work with meld (segmentation fault), but sample PyGTK programs work OK.
UPDATE 2 since then a new package Py3GTK3 appeared on the same sourceforge page. Haven't tested though.
回答4:
There is now a mac package on sourceforge
回答5:
Download the latest package from http://sourceforge.net/projects/macpkg/files/PyGTK/ and install.
If you're just trying to use the system python, this is all you'll have to do.
If you're not, the following is how to install it with pyenv, which can be installed with Homebrew. With brew installed, you can install version pyenv and Python 2.7.8 with:
brew install pyenv && pyenv install 2.7.8 After you've done that, you'll then have copy the gtk package and its dependencies into your python installation:
cd /opt/gtk/lib/python2.7/site-packages/ && \ cp * ~/.pyenv/versions/2.7.8/lib/python2.7/site-packages/ That's it. You can also similarly install the Py3GTK3 package which has packages for python 2.7 and 3.2 from http://sourceforge.net/projects/macpkg/files/Py3GTK3/.
回答6:
Have you tried doing it using macports? This website shows how.