我使用的是 Debian 6.04 和 Python 2.7
我编译了 Python 2.7,(./configure,make,make install)
在控制台中:
>python2.7
Python 2.7.3 (default, Jul 28 2012, 16:54:06)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gtk
如何在 Python 2.7 中安装 gtk?
在 Python 2.6 中:
tiger@debian:~$ python
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
>>> import pygtk
>>> import gobject
最佳答案
尝试使用 pip/python-pip/easy_install 安装它。 在 Fedora 上我是这样安装的:
sudo pip install PyGTK
关于python - python2.7如何安装gtk?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11699675/