« My first Cherokee patch commited! | Main | WTF! PyGTK is f**king everywere! »

My chrismas present: All-in-One win32 python installer.

Since my Cherokee patch, I've been playing around with NSIS, the Windows tool for building installers. One of my obsessions with software is that entry barriers should be as low as possible in order to have a successful product and let people enjoy with it.

I've been using Python and PyGTK for five years, I think that right now, are probably the easiest and funniest tools to get introduced into software development and gui programming on the free software world. One of the most interesting feature is that they're both cross-platform, so you can write software that can run in 90% of its code on almost any UNIX, Windows and Mac OS X.

Although, the problem with PyGTK is that is hard to setup on the most popular enviroment,  Windows, which kills its potential success on the mass audience.  Why is that hard to setup a PyGTK working enviroment right now? Well, let's take a look on the steps you need to take if you don't know anything about python and/or pygtk:

  1. Go to pygtk.org
  2. Go to the download section and figure out where the Windows installer is.
  3. Download the PyGTK Windows Installer from the GNOME FTP.
  4. Install it and figure out that you need the Python Installer (that's not explained).
  5. Install it and figure out that you also need PyCairo and PyGobject. (not explained)
  6. Install Py[Cairo|Object], try PyGTK, and figure out that you also need the  GTK+ runtime for windows, which is on an unofficial webpage, since the official win32 gtk+ binaries are a bunch of .zip files. (not explained and very hard to figure out)
  7. Write "Hello World!".

As a summary, you have:

  • 5 different installers from 3 different sites
  • 3 critical steps not explained from the website, which force people to ask google and waste lot of time.

I would like to know how many windows users (which are the most of the people out there) have had gave up before to be able to even write a hello world and make it work.

Solutions? Well, the website issue is been addressed since I've been discussing this on the mailing list. Join the discussion.

Until then I've been using my NSIS-fu, and I've created a rudimentary installer that has everything together:



There is some things that I want to fix, for example, the PyGTK modules cannot be installed in silent mode, so it appears three dialogs "extra" that I would like to override. I also would like to fix some uninstalling problems and be able to detect previous Gtk+ or Python installations on runtime.

If you wanna help, patches are welcome:

Comments

This is Great! I have posted some related sites over here: http://todaytop10.com

This looks great. I'm thinking of adding a link here to the site of my app so windows users can run the latest version from source rather than waiting for someone to "freeze" my app into an executable (which happens once in a blue moon). Are you going to maintain an up-to-date version of this installer? If you are, I'll definitely point users here!

I was looking for librsvg python bindings for windows install but was not successful. It is part of gnome-desktop but I do not know how to pull it out and compile on its own on windows. Does anyone know of a precompiled windows installer? Or some info on how to prepare one?

Great work

Can you add the python-mysql module ? it would be great having

can you add the mysql module, it would be great to having!!!

I was thinking that gtk wasn't worth while when I moved to 2.5 (and it stopped working) and now I am willing to try it again (since now there is something that can be distributed)... I don't know that my trust is entirely back but it helps the whole concept, There seems to be some .net issue with some apps that might be able to use the same concept..

Thanks man...!! great work.

I am new to both, Python and GTK+. I am in dire need of the librsvg python bindings, but for Windows. Could you tell me if it is even possible to compile/create those in some way? Thanks in advance for any kind of pointers you can provide me with.

I love the new Mac by Apple. Does anyone have one?

http://www.moneyspells.ca

Maybe yes-maybe no, maybe sex- I don't know....My nick is ChicaSensual20...wanna see me on cam?...[url=http://chicasensual20.tripod.com]chat page[/url]!!!
http://chicasensual20.tripod.com

You're my hero! I've been struggling all day to get my python plug-in for the GIMP to work on Windows. I first thought "python script, just copy it over, right?". The PyGObject was killing me. Anyway, thanks for putting this together. It's a great favor to the community.

As Michael reports,I've also found that mixing pyGTK-all-in-one with mod_python gives incompatibility leaving mod_python unable to load and rendering Apache unusable.
I had to use stock Python binaries. So, I guess there's need for more test and use cases regarding widerd compatibility for python apps (including GTK ones).

Hi,

I'm using Python 2.4 because this version is required for the Python plugin for SPSS v14. So if I use your installer, Python 2.5 will become the default? Or can the two versions peacefully co-exist? See also: Murray | 03/26/2007 at 12:00 AM

Anyway, thanks for your efforts!

AJ

One thing to note is that it is worth looking in c:\windows\system32 to check that the gtk DLLs don't already exists. If for example libglib-2.0.0.dll exists in system32 then you can get an "import gobject as _gobject - ImportError: DLL load failed" error

The installer is broken if an older version of GTK+ is already installed on the system.

I installed GTK+ long long ago for GIMP and forgot about it. It took me a good while to figure out what is wrong.

I think this is a common scenario.

I also recommend that you do not propose to install Python if it is already found on the system.

People expect to click Next Next Finish in installers, not to read stuff.

You said :
""There is some things that I want to fix, for example, the PyGTK modules cannot be installed in silent mode, so it appears three dialogs "extra" that I would like to override. I also would like to fix some uninstalling problems and be able to detect previous Gtk+ or Python installations on runtime.""

And here is a possible solution :
Don't override them but use a tool like http://www.autoitscript.com/autoit3/ (automation tool).(wich could be launched by your script or used alone)

I've done a private installer who install GTK++,Glade,Mingw,CodeBlocks,Doxygen with it. That works great and fine. Why not gfive it a try ?
The only disadvantage is than you can't easily revert the install process unless you do the script to do it.

I haven't tested right now your installer but I plan to do it and may be do the work.

Thanks for the nice idea!
I have tried to install each of the required software one by one too, and still have troubles, but when I try to download your All-in-One Installer, the link seems to be broken. There is another link?

Many thanks for creating the all-in-one download for Windows. I can't thank you enough. One day I'll tell you the whole story.

Meanwhile I'm trying to run Winzig and hitting problem with gobject, which is what I had hoped to solve by installing the all-in-one. Error message below:

Traceback (most recent call last):
File "C:\a1\bin\PyGTK\Python\dms\Winzig\wcalendar.py", line 25, in
import gobject
File "C:\a1\bin\PyGTK\Python\lib\site-packages\gtk-2.0\gobject\__init__.py", line 30, in
from _gobject import *
ImportError: DLL load failed: The specified procedure could not be found.

Thanks for this great installer package, I'm just starting working with python and gtk to develop some small tools for me to use, and learn more about python, and this helped me a lot.
Some small glitch so: I'm running Vista Business 64 Bit and it seems like the path to the gtk dll is not set correctly after the install. The easy way to solve this is to just install gtk-dev-2.10.7-win32-1.exe afterwards, if not the libglib-2.0-0.dll won't be not found.

Great work none the less!

"So you can find the information on it on my search resource
http://fileshunt.com"

Post a comment

If you have a TypeKey or TypePad account, please Sign In