Monday, April 14, 2008

I Wish to Register a Complaint!

Eventually I'll learn to quit while I'm ahead.

So what happened is this. I was trying to install mod_python on my iMac under Leopard. To make a long story short, it appears to be well-known that there are problems with mod_python on Leopard. But the two links go to what appear to be fixes, so no issues, eh? Actually, the page I ended up using was this one, just because it looked more detailed.

It worked.

Initially.

Some background: the problem, in a nutshell, is that Apache2 is set up to be 64-bit capable on Leopard - but the default compilation of mod_python gives you a 32-bit version. Well, more specifically, mod_python itself is happy being 64-bit, but the c compiler will compile relevant portions for 32-bit architecture unless you override it. So, after ./configure-ing in the normal way, you have to monkey with the src/Makefile to get gcc to compile for 64-bit architecture and - presto! It works, right?

Erm - not exactly. Which is to say, yes, it did. But then I ran into two other problems with the particular program that I needed mod_python to run.

The first of these involved _psp.so - something that gets built at compile time for mod_python. This helpful forum link explained how to do it. The problem, and fix, were the same as before: _psp.so needs to be 64-bit, only the default installer doesn't make it that way, so you have to go monkey with the dist/setup.py file as described. It worked, no complaints.

The other problem was specific to my program again - it imports a module called bsddb - a database utility - that while it apparently is installed by default with most Python distributions, it might maybe not be on Leopard.

Rather than use the crazy instructions from the previous link (though I'm regretting it now, let me tell you), I decided just to reintall Python. There's a new version of 2.5 out as of maybe a month ago, and it couldn't hurt, right? After all, the new version on the Python downloads page claimed to include bsddb this time 'round.

Bucept it did hurt. I reintalled Python, and suddenly the clever compile hack of compiling for all three architectures didn't work anymore. Bugger!

And of course, it continues not to work, even though I've pointed my Python simlink back to the old version of Python. So this is completely frustrating. Somewhere along the line something horribly obscure got changed, and I know I'm gonna have a helluva time figuring out just what it was.

All of which goes to show - I should've just quit while I was ahead. I should've been satisfied once I had mod_python itself working, and then worried later about getting the bsddb module installed propertly.

Kicking self.

Although I would just like to add - Apple does have a lot of nerve advertising how well Apache and Python, among other things, supposedly work on the new operating system, and then not including basic things like mod_python and bsddb. It really does sort of defeat the purpose of buying a Mac if even Linux makes it easier to get a LAMP-P-as-in-Python system up and running. The whole point of Mac in the OS X generation is supposed to be that it gives you all power of UNIX with all the niceties of a well-integrated interface. And yet, now that Linux has evolved to the simplicity of the sudo apt-get install program phase, you really start to wonder what all the nice Mac interface is for if it just keeps you cut off, in the end, from the cool open-source stuff (or else makes it a headache to install).

3 Comments:

At 4:45 PM, Blogger Graham Dumpleton said...

You could have saved yourself a lot of trouble by following instructions from:

http://www.modpython.org/pipermail/mod_python/2008-March/024954.html

and checkout latest mod_python source code which fixes all the build issues.

If you were only wanting to host WSGI applications, you could have saved yourself even more time by using mod_wsgi instead as it compiles out of the box on Leopard.

 
At 2:34 AM, Blogger Joshua said...

Thanks! Actually, I thought I had the latest version of mod_python - but apparently not. I'll give it another try.

 
At 7:09 PM, Anonymous Anonymous said...

You could have saved even more time by using a windows program that actually works. I suppose we all choose our own battles.

 

Post a Comment

Links to this post:

Create a Link

<< Home