简体   繁体   中英

PyGtk Installation issues on Windows 8

I'm working on a project which have few dependencies. Among many one is PyGTK to support GUI.
I gave a start to this project on Windows 7 64-bit machine with Python 2.7.10. Later, I choose to work on the same project on my personal machine which is a Windows 8 64-bit machine with Python 2.7.10.

I used PyGtk all-in-one installer to handle all the dependencies related to PyGTK initially on my Win7 machine.
I used the same installer on my Win8 machine. Under the hood I don't know what's happening, but all I get is this -

>>> import pygtk
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import pygtk
ImportError: No module named pygtk

Not sure if this has something to do with the installer as I found that many installed PyGTK using the same installer on Win8 and they are good to go.
What you all think could be possible reason behind this.

PS I even tried to installing PyGTK and all its dependencies manually as described here . Which was not much for my help.

As @gianmt mentioned PyGTK is umaintained and if you start a new project you should use PyGObject (also known as Python-GI).

You can find Windows builds for PyGObject here: http://sourceforge.net/projects/pygobjectwin32/files/?source=navbar

Be advised that setting up a development environment is easier on Linux, where all the required packages can be installed using a few simple commands. I would recommend first trying it out in a virtual machine (eg virtualbox). If you use for example Fedora 22 you will have access to Gnome-Builder which is a IDE especially suited to develop GTK+ programs. Furthermore if would also recommend using Python 3. It does not make a huge difference for GUI development, and if you write new code, you might as well make it compatible with the new version. If the program also needs to run on Windows pynsist is a easy (and documented) possibility to package it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM