如何使用macports正确安装pyGTK? [英] How to correctly install pyGTK using macports?

查看:96
本文介绍了如何使用macports正确安装pyGTK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的python代码将GTK用于某些GUI,现在我需要在OSX(10.6 Snow Leopard和10.7 Lion)上运行其中的一些代码.不幸的是,非官方pyGTK build 在GTK窗口调整大小时崩溃,所以我决定测试macports版本.我通过以下macports命令安装了python和pygtk:

My python code uses GTK for some GUI and now i need to run some of it on OSX (10.6 Snow Leopard and 10.7 Lion). Unfortunately, unofficial pyGTK build crashes on window GTK windows resize, so i decided to test macports version. I installed python and pygtk via following macports commands:

sudo port install python26
sudo port select --set python python26
sudo port install py-gtk2

从控制台运行python可以正确启动python的macports版本.但是试图执行 import gtkimport pygtk失败,并出现以下错误:该软件包不可用:(.

Running python from console correctly starts macports version of python. But trying to execute import gtk or import pygtk fails with error that such package is not available :(.

我觉得我错过了一些非常简单的方法来使所有工作正常进行.诸如为macports python或其他设置正确的site-package之类的东西.也许某些大师可能会分享一些智慧?

I have a feeling that I missed something very simple to get all to work. Something like setting correct site-package for macports python or whatever. Maybe some guru may share a bit of wisdom?

更新:仔细检查发现py-gtk2仅安装在/opt/local/lib/python2.4/site-packages中,而.../python2.6/site-packages.../python2.7/site-packages留为空白.运行python 2.4的macports版本可以使用pyGTK.但是我想要python 2.6(preferred)或2.7:(.

UPDATE: Careful examination revealed that py-gtk2 was installed only into /opt/local/lib/python2.4/site-packages, leaving .../python2.6/site-packages and .../python2.7/site-packages blank. Running macports version of python 2.4 allows me to use pyGTK. But I want it with python 2.6 (preferred) or 2.7 :(.

推荐答案

端口名称不正确.正确的端口是py25-gtk/py26-gtk/py27-gtk.

Port name was incorrect. Correct ports are py25-gtk / py26-gtk / py27-gtk.

已更新:最近已重命名为py25-pygtk/py26-pygtk/py27-pygtk

Updated: recently renamed to py25-pygtk / py26-pygtk / py27-pygtk

这篇关于如何使用macports正确安装pyGTK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆