Taming the Python

So, last night with a little help from Dave, I got a little further in the Python adventure. He suggested setting up a Virtual Environment and trying to install the packages there. In the end, I went with numpy 1.2.0, scipy 0.8, matlibplot 1.0 (0.99 seems to have issues on OSX), but hit a brick wall with rpy. The first problem was rpy is old. Very old. The regex used to try and find your R version number only allowed for \d.\d.\d – I am on R 2.11.1, so I fixed the regex and all was well, but I managed to get an awful lot of other warnings/errors. By this time it was 12:20am, and i’d been trying on and off for 12 hours to get this to work.

This morning I took a fresh approach…enter an old windows laptop, no python install, very old R (2.4!). I instaled python 2.5 (from the .msi), numpy 1.1.0 (from .exe), scipy 0.7 (from .exe), matplotlib 0.99 (from .exe), tried importing and scipy claimed it wanted numpy 1.2.0, so installed that (some good version checking there on checking minimum requirements for the script i’m trying to run…). When I tried importing matplotlib it decided it needed win32api, so had a bit of a google and installed PyWin32, which fixed the matplotlib issue. I then installed rpy 1.0.3 (from .exe) which worked!

Had a bit of a faff trying to sort out the paths, it’s been so long since I used windows I had to check where the System Variables thing is, then when I added R and Python they didn’t come up in the path. After some head scratching, I went with path = %PATH%;C:\python26
and then the same for R.

The script is now running…if it works, I might tell you all what it is 😉

Leave a Reply