11 March 2007

pygame setup

The Prerequisite Quest
So I have some dependencies that I'm supposed to install:
Numeric, PyObjC, PIL, and SDL

So I got Numeric and PIL from pythonmac. (Yes, the same place that I complained didn't have a working 2.5 installer.)

Futile Search for PyObjC

PyObjC doesn't have a 2.5 installer, I googled and came up with this:
> The current installer refuses to install after a python 2.5 install.
> Is there a way around this?

Install from source. Make sure you have Xcode installed, including
the Universal SDK and then install setuptools and use
'easy_install-2.5 install pyobjc' to install PyObjC.

That sounds useful, so I throw caution to the wind and start hunting down setuptools. Seems like a really easy download, although their page is strange. Go here to get the "egg" (like a deb, gem, rpm...), but don't bother with the "Downloads" section, just go right to the bottom of the page. (The self-referring link is a little confusing, but I assume some automated solution set it up like that. Still, begs for a bug report.)

Once you've installed setuptools, you'll have easy_install on the command line. Run
easy_install pyobjc
to install PyObjC. (Yes, I know that's not the same as the mailinglist instructions, but this is how you install packages with EasyInstall.)

However, all of the above doesn't work. After a big stack trace, I get:
File "/private/tmp/easy_install-Srjxqo/pyobjc-1.4/source-deps/py2app-source/src/macholib/util.py", line 33, in
TypeError: Error when calling the metaclass bases
first argument must be callable

So on to another method...

Non-easy_install of PyObjC
EasyInstall (as I understand) is just supposed to make it easier to install python packages. But there's always the old fashioned setup.py way:
  1. Download the pyobjc source from http://pyobjc.sourceforge.net/software/
  2. Untar to a temp directory
  3. From that directory (should see an Install.txt in there), run python setup.py build
  4. Run python setup.py install
  5. And if you want py2app and other fancy things, run python setup.py bdist_mpkg --open

Then follow those build and install steps (1-4) again getting the pygame source package from http://www.pygame.org/download.shtml

After that, you should be able to run the simple Chimp example from pygame.

(Although I seem to be missing the sdl_ttf package to do font rendering.)

Progress is made!

No comments: