Installing Python25 and PyGTK on XP

Posted by admin on December 7, 2010

Installing PyGTK can be frustrating if you have the wrong file set or downloaded from yet another incomplete source. This is a quick install guide, an easy walk through with the links to install PyGTK into Python25 complete with the Glade Editor.

First, download and install Python25 from http://www.python.org/ftp/python/2.5/python-2.5.msi

capture_07122010_230846.jpg

Install Python25 to "c:\python25\" for all users

 

capture_07122010_230849.jpg

Use default settings and click next

 

Now install the file Glade3-3.6.7-with-GTK+ from http://ftp.gnome.org/pub/GNOME/binaries/win32/glade3/3.6/glade3-3.6.7-with-GTK+.exe  This will add the Glade-3.6.6 editor into your programs list.

capture_07122010_231133.jpg

This installs to a different folder location

Now Download and install PyCairoPyGobject and  PyGTK

capture_07122010_232953.jpg

All versions should install for python25 and install into the 'site-packages' folder

 

Last but not least you need to add a path for 'python25.exe' in the environment editor.   Click on 'Start', 'Control Panel', 'System' and then on the 'Advanced' tab.

capture_07122010_233044.jpg

Now click on the 'Enviroment Variables'

 

capture_07122010_233101.jpg

Click on the 'Path' in 'System Variables'  and click edit 

 

 add ;c:\python25 to the end of the line and then okay.

Now you are ready to reboot and test the installation.The path that you added will not be reconized by XP until you reboot. After you have rebooted click 'Start', 'Accessories' and then 'Command Prompt'.If you type in 'python' and all has gone well and the path is correct you should be greeted with the python startup message.

capture_07122010_233621.jpg

Okay now test your imports for pygtk as shown below. The last check is 'sys.path', this prints the path python uses to search for files.

  1. >>> import gtk
  2. >>> import gobject
  3. >>> import pygtk
  4. >>> import gtk.glade
  5. >>>
  6. >>> import sys
  7. >>> sys.path
  8. ['', 'C:\\WINDOWS\\system32\\python25.zip', 'C:\\Python25\\DLLs', 'C:\\Python25\
  9. \lib', 'C:\\Python25\\lib\\plat-win', 'C:\\Python25\\lib\\lib-tk', 'C:\\Python25
  10. ', 'C:\\Python25\\lib\\site-packages', 'C:\\Python25\\lib\\site-packages\\gtk-2.
  11. 0']
  12. >>>

Note the windows use of '\' is displayed as a '\\'. This is not a ytpe, the convention for python in it's native envroment is '/' and the '\\' helps with this confusion.

Here are some extras that my interest you to add you your python setup...

Comments:

Posted by Anon on
Kool :)
Leave a Reply



(Your email will not be publicly displayed.)

Please type the letters and numbers shown in the image.Captcha Code