Archive for the ‘Brick Walls’ Category

Adventure with a Python

Tuesday, August 10th, 2010

No, not the big snakey kind, just my first attempt to get something working in Python. One of the first things I did when I got my laptop back in 2007 was install all the developer tools. The first thing I did was install a shiny new (well, slightly tarnished in the face of Python v3!) copy of 2.7.

This turned out to be mistake number 1. The script I was trying to run requires numpy, scipy, matlibplot and rpy. numpy installs from a binary no probs, I think “ooh this is easy”, I then realise there wasn’t a binary for scipy that worked with 2.7. No problem, i’ll go simpler. Python apparantly has something called easy_install – yay! $ easy_install scipy …all runs through. I ran python, then tried import scipy, oh, it hasn’t found it. Sneaking suspicion sinks in, and I discover Python 2.5 lurking. OK, no problems, just download scipy.gz (not it’s real name ;-)), uncompress, fiddle in the command line, wait a while (the README warns that this can take an hour on a slow computer, and then everything fails. Realise I forgot to “sudo”, wait another 10 mins, fails again. Sulk a bit. Hit google. Apparantly scipy and 2.7 can be a pain.

Give up. Install python 2.6, install numpy, scipy, matlibplot. Feel smug. Decide to update R, as there is a new version (clearly not learning from the Python mistake here).

So i’m still stuck on rpy, it seems to think it has installed, but none of the python family are capable of importing it. Perhaps, after frustrating me for the afternoon, I will head home, try again and it will work first time.