我的 Windows GTK 出了什么问题?用于Python安装?
对此感到非常沮丧。我为我的 32 位系统安装了 pygtk 2.24、pycairo 1.8.10 和 pyobject 2.28.3,并安装了 2.7 的 Python 版本。我已经安装并运行了 GTK+。
另外,我在 sys.path 中设置了“C:\Python27\Lib\site-packages\gtk-2.0”的路径(pygtk 和 pobject 所在的位置),并且 GTK_BASEPATH 的 Path 系统变量设置为 C:\gtk, GTK+ 所在的地方。
当我尝试导入 gtk 时出现此错误:
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import gtk
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30, in <module>
import gobject as _gobject
File "C:\Python27\lib\site-packages\gtk-2.0\gobject\__init__.py", line 26, in <module>
from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
File "C:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in <module>
from glib._glib import *
ImportError: DLL load failed: The specified procedure could not be found.
我无法弄清楚出了什么问题。有人有什么想法吗?
编辑
找到这篇文章,我发现了一个 GtkSharp 的变量(不知道它来自哪里),但删除它并没有帮助。
Getting pretty frustrated with this. I installed pygtk 2.24, pycairo 1.8.10, and pyobject 2.28.3 all for my 32 bit system and my installed Python version of 2.7. I have GTK+ installed and working.
Also, I have the path to "C:\Python27\Lib\site-packages\gtk-2.0" set in sys.path (where pygtk and pobject reside) and my Path system variable for GTK_BASEPATH is set to C:\gtk, where GTK+ resides.
I get this error when I attempt to import gtk:
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import gtk
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30, in <module>
import gobject as _gobject
File "C:\Python27\lib\site-packages\gtk-2.0\gobject\__init__.py", line 26, in <module>
from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
File "C:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in <module>
from glib._glib import *
ImportError: DLL load failed: The specified procedure could not be found.
I can't figure out what's wrong. Anyone have any ideas?
EDIT
Found this post, and I found a variable for GtkSharp (don't know where it came from) but removing it did not help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试卸载所有这些(包括 GTK+,除非其他东西需要它)并使用 PyGTK 一体化安装程序。
Try uninstalling all of that (including GTK+, unless something else needs it) and use the PyGTK all-in-one installer instead.
如果您正在编译自己的版本,请确保进入“dist”文件夹并运行创建的安装程序以在计算机上使用您的版本。
Windows 编译说明:
http://git.gnome.org/browse/pygtk/tree/README.win32
If you're compiling your own, make sure you go in the 'dist' folder and run the created installer to use your version on your machine.
Windows compilation directions:
http://git.gnome.org/browse/pygtk/tree/README.win32