Search This Blog

Wednesday, July 14, 2010

Using python with Gnumeric in Windows XP

Background Screenshot-20100715054119Thu.png


Quite sometime ago, I had download Gnumeric as a portable spreadsheet solution. It is a nifty application that loads up fast and does what spreadsheets do. At the right is a screen shot of the memory usage of my Portable Gnumeric.


Side Note: I'm using Process Explorer to show you the stat. It is a great app which I think should be installed by default on every windows machine. Some explanation of what you see in the diagram. Private Bytes is the the memory that can only be accessed by the application, wheras Working Set = Private Bytes + Shared Memories.


Then I read that Gnumeric provides Python integration! But my initial tries to enable the python integration using the instructions from here failed. The instruction is geared to a Linux setup but it can be done on XP as well. And the rest of this post is about how I got it working.


My Setup


I'm using version 1.10.5 of Gnumeric. I'd downloaded my original version from portable appts and updated Gnumeric to the latest version.


The run down


I will tell you the run down to get the python integration working. Then I will talk about some of the errors that you might encounter.



  • Make sure that you have at least python version 2.6 installed. Gnumeric python integration needs python version 2.6. I'd tried using Python 2.5, but no go.

  • Make sure that you've installed the Py-GTK python module. Py-GTK can be found here, and it, in turn, needs 3 other python modules call PyGTK, PyCairo and PyGObject. So you need to individually click on the links to the 3 modules on the page and download and install them. And then....

  • Make sure that GTK is installed as well. This is simply a matter of going here and download a release then unzipping the package someone on your machine and adding the path of the bin subfolder to your path. i.e. you should see the following



C:\>set path


Path=...\gtk\bin\;...



And Success!


If everything goes smoothly, after start Gnumeric, goes to menu>Tools>Plugins scroll down to the check the 2 python related boxes. Then you should see a new Options appear under menu>Tools> called "Python console". Activate that and you should see the following.


Screenshot-20100715063554Thu.png


Possible Problems


If your Gnumeric crashed with a Windows Error message, probably one of the following occured.



  • Python, is not installed

  • Incorrect version of python is installed.

  • PythonHome is not specified.

  • GTK is not installed

  • GTK\bin is not added to %PATH%


And finally


For ideas about what you can do with Python plugin in Gnumeric, please refer to this page as mentioned above.


I hope you managed to get your Python setup for Gnumeric. And use the beautiful language that is Python to simplify your spreadsheet scripting. And did I mentioned that both Python and Gnumeric are opensourced? :)


Created : 2010.07.15.0647hrs(Thu);




Technorati :

Del.icio.us :

1 comment:

Unknown said...

Great! very usefull ticket for my project pyeurocode2 at www.bet-batiment.fr . I create a set of civil enginering function using gnumeric and python. I create them under linux but a lot of engineer work en windows.
Thank you