Windows 上的 Python:gtk 导入错误。
我对 python 很感兴趣,并且想学习 gui 编程。
我安装了 pygtk 和 gtk,但当我尝试导入 gtk 时收到此消息:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import gtk
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 40, in <module>
from gtk import _gtk
ImportError: DLL load failed: The specified procedure could not be found.
首先,我尝试从几个不同的源下载和安装。那不起作用,现在我的程序文件中有 Gtk+ 和 GTK2 Runtime 文件夹。
我认为这些是 GTK 运行时的不同版本? 接下来我用 google 搜索了这个,并找到了一些建议来确保 GTK 在我的路径中。我已在这两个目录中添加了 lib 和 bin 文件夹的所有路径组合。仍然没有工作。 接下来我应该尝试什么? 谢谢。
I'm having fun with python, and would like to learn gui programming.
I installed pygtk, and gtk but I get this message when I try to import gtk:
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import gtk
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 40, in <module>
from gtk import _gtk
ImportError: DLL load failed: The specified procedure could not be found.
First I tried downloading and installing from several different sources. That didn't work, now I have Gtk+ and GTK2 Runtime folders in my program files.
I take it that these are different versions of GTK runtime?
Next I googled this, and found suggestions to make sure GTK was in my path. I've added every combination of paths to the lib and bin folders in these two directories. Still not working.
What should I try next?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PyGTK 本身有几个依赖项(cairo 等),您是否安装了所有依赖项?
PyGTK itself has several dependencies (cairo et al), did you install all of them?