适用于 Mac OS X 的 PyGTK 在哪里?

发布于 2024-07-27 20:57:10 字数 171 浏览 4 评论 0 原文

是否有适用于当前 mac os x、Python 的 PyGTK 的二进制文件? 我使用多种桌面环境(mac、windows、gnome),并且确实认为 python 缺乏跨平台 GUI 是一个问题。 有谁知道在哪里可以找到适用于 Mac 的 PyGTK 和 GTK 的内置版本? 我无法克隆 git 存储库,它总是超时。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

紫瑟鸿黎 2024-08-03 20:57:11

这里有一个正在测试的 PyGTK 2.24 安装程序, 已在 PyGTK 列表中宣布

UPDATE 项目已移至 macpkg 的 sourceforge 页面

我无法让它与 meld (分段错误)一起工作,但示例 PyGTK 程序工作正常。

UPDATE 2 此后,新包 Py3GTK3 出现在同一 sourceforge 页面上。 不过还没有测试过。

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.

网白 2024-08-03 20:57:11

sourceforge 上现在有一个 mac 软件包

There is now a mac package on sourceforge

太阳公公是暖光 2024-08-03 20:57:11

http://sourceforge.net/projects/mcpkg/files/PyGTK/< /a> 并安装。

如果你只是想使用系统 python,这就是你所要做的。

如果不是的话,下面是如何用pyenv安装,可以用自制。 安装了brew后,您可以安装版本pyenv和Python 2.7.8:

brew install pyenv && pyenv install 2.7.8

完成此操作后,您将把gtk包及其依赖项复制到您的python安装中:

cd /opt/gtk/lib/python2.7/site-packages/ && \
cp * ~/.pyenv/versions/2.7.8/lib/python2.7/site-packages/

就是这样。 您还可以类似地安装 Py3GTK3 软件包,其中包含来自 http://sourceforge 的 python 2.7 和 3.2 软件包.net/projects/mcpkg/files/Py3GTK3/

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/.

我不在是我 2024-08-03 20:57:11

您是否尝试过使用 macports 来做到这一点? 该网站展示了如何< /a>.

Have you tried doing it using macports? This website shows how.

就是爱搞怪 2024-08-03 20:57:10

brew install pygtk 为我工作(需要 homebrew)。

已确认也适用于 OS X 10.10,但默认情况下它会将其安装到brew的Python发行版中,因此如果您仍在使用本机python,它将找不到它。

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.

影子是时光的心 2024-08-03 20:57:10

我不使用 macports 但似乎 jhbuild 对我有用。 以下是我已完成的步骤。

  1. 从以下位置下载 gtk-osx-build-setup.sh:https://raw.github.com/jralls/gtk-osx-build/master/gtk-osx-build-setup.sh 并保存到你的主目录。
  2. 启动终端并导航到您的主目录并运行命令 sh gtk-osx-build-setup.sh
  3. shell 脚本会警告您 ~/.local/bin未添加到您的环境变量中来执行此操作,请编辑位于主目录的 .profile 文件和 /Users//.local/bin 以你的环境变量。 要了解有关如何编辑此文件的更多信息,请查看:http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/
  4. 之后,执行 ~/.local/ bin/jhbuild bootstrap 命令。 它将下载并安装一些必要的实用程序。
  5. 请在以下位置下载并安装 gtk+ osx 框架的测试版:http://ftp.imendio.com/pub/imendio/gtk-osx/Gtk-Framework-2.14-LATEST.dmg
  6. 在安装之前, meta-gtk-osx-python,您需要构建并安装一些 jhbuild 不会自动安装的其他软件包,所以我所做的是安装了 libpng 通过执行命令:~/.local/bin/jhbuild build libpng
  7. 您还需要安装 libtiff,因此执行命令:~/. local/bin/jhbuild build libtiff
  8. 以及 gtk-doc 是必需的,所以: ~/.local/bin/jhbuild build gtk-doc
  9. 最后你可以现在通过执行以下操作安装 meta-gtk-osx-python~/.local/bin/jhbuild build meta-gtk-osx-python

让我知道它是否有效。

I don't use macports but it seems that jhbuild works for me. Below is the steps that I've done.

  1. download gtk-osx-build-setup.sh from: https://raw.github.com/jralls/gtk-osx-build/master/gtk-osx-build-setup.sh and save it to your home directory.
  2. fire up terminal and navigate to your home directory and run the command sh gtk-osx-build-setup.sh
  3. the shell script will warn you that ~/.local/bin isn't added to your environment variable to do this, edit your .profile file located at your home directory and /Users/<username>/.local/bin to your environment variable. to know more on how to edit this file check out: http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/
  4. after that, do a ~/.local/bin/jhbuild bootstrap command. it will download and install some necessary utilities.
  5. 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
  6. before installing the meta-gtk-osx-python, you need to build and install some other packages that jhbuild doesn't install automatically, so what i did was i installed libpng by doing the command: ~/.local/bin/jhbuild build libpng
  7. you also need to install libtiff so do the command: ~/.local/bin/jhbuild build libtiff
  8. and also gtk-doc is needed so: ~/.local/bin/jhbuild build gtk-doc
  9. and finally you can now install meta-gtk-osx-python by doing a: ~/.local/bin/jhbuild build meta-gtk-osx-python

Let me know if it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文