Saturday, May 5, 2012

Beware of mixing mrjob & pythonwin

I installed mrjob during an excellent course given at the Hacker Dojo on MapReduce.  I love mrjob (it is great for programming MapReduce in python - try it!), but as soon as I installed it my pythonwin installation (a FANTASTIC editor, because there is intellisense INSIDE the interpreter, and it was the only python interpreter with this feature for a very long time).  Whenever I try to use the "Find" feature I get the error:

struct.error: unpack requires a string argument of length 20
win32ui.error: Error in Command Message handler for command ID 109, Code 0

It is very hard to edit code without the Find feature!  A member at python-forum named basc had the exact same issue back in 2010.  No matter how many times I uninstall/reinstall etc. (and remove old files so the uninstall is as complete as I can make it) the error doesn't go away.  I tried at length again today to fix the installation to no avail.  This really is one of those classic operating system problems we used to get all the time due to register errors back in the 90's, but I haven't had such a resilient OS error in a very long time.  It is enough to make me switch operating systems, but I am truly torn between Mac and Linux (Linux laptop battery life is historically terrible - so a Macbook Air and its incredible 10+ hours of battery life running Linux would lose one of its best features :-(

For now I installed a different version of Python and Pythonwin in a separate location and use that editor for now.  To run things in the old Python installation I'll have to copy/paste my source files, but that is not so bad.

Just a heads up for pythonwin users trying to do MapReduce with mrjob.  If anybody knows how to fix the above problem please leave a comment and I will post a follow-up so Google can find it.

No comments:

Post a Comment