macos 在 Mac OS X 上安装 pygtk 的最简单方法

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5089649/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 07:44:31  来源:igfitidea点击:

Easiest way to install pygtk on Mac OS X

pythonmacosgtkpiphomebrew

提问by Natan Yellin

Ideally, I would like to install pygtk using pip or Homebrew. Neither one seems to be possible.

理想情况下,我想使用 pip 或 Homebrew 安装 pygtk。似乎没有一个是可能的。

I am running Leopard.

我在跑豹。

采纳答案by Andreas Jung

You need to install pygtk yourself - at least because since some of its dependencies like dextras are not available through PyPI.

您需要自己安装 pygtk - 至少因为它的某些依赖项(如 dextras)无法通过 PyPI 获得。

回答by Rui Andrada

I've archive some success running tryton which uses pygtk with Homebrew.

我已经在运行 tryton 时取得了一些成功,该 tryton 将 pygtk 与 Homebrew 结合使用。

I've uninstalled anything installed before in Homebrew and installed again with:

我已经卸载了之前在 Homebrew 中安装的任何东西,然后再次安装:

brew install pygtk

I guess to do the trick is setting the PYTHONPATH as brew says end of install, I do my setup in ~/.bashrc file.

我想这样做的技巧是设置 PYTHONPATH 就像 brew 说安装结束一样,我在 ~/.bashrc 文件中进行设置。

export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

I hope it helps

我希望它有帮助