19 October 2007

Return, hopefully

Long time away. School got in the way. I did manage to play around with pygame. I got the chimp example working and then modified it to implement a chase algorithm.

But then came school and I was long distracted making phones and sentient beings.

But now I'm back on track to work again. I've started playing around with PyObjC. Hopefully, I'll have some pygame progress soon too.

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!

"The software has been successfully installed"

So I feared before that I wouldn't be able to easily install Python 2.5 on my Mac (10.4.8).

I had been using this url to get my python 2.5 installer:

But of course, that's the wrong url. If I use this one, then I actually make progress:

Hurrah. Time to go ask for some fixes and then get myself pygame.

You might think to yourself, why didn't he just verify the files? Well dmg files seem to do their own kind of verification, but I also checked the md5sums:

$ md5sum -v python-2.5-macosx.dmg ../python-2.5-macosx.dmg
9ea85494251357970d83a023658fddc7 python-2.5-macosx.dmg
9ea85494251357970d83a023658fddc7 ../python-2.5-macosx.dmg

I don't need to tell you which is which, they're identical! (And they are the same as the posted md5sums.) Don't know how that happened.

[edit:verify, linkify]

Installation Woes

So it appears that Python 2.5 doesn't want me. I tried to install the newest version of Python (2.5) and everything seemed fine but at the last step of the installer (where you click 'Install'), it hangs and I get Beachball of Doom. Apparently that's what I get for using a Mac : (

Odd too. You'd think that Apple would make sure that developer tools like Python would work flawlessly on their system. I want to make software for their customers. Sigh, you can't make all of the people happy all of the time.

So my options now are compiling from source or trying to track down my problem. Which is more daunting...


So I decided to start doing a real project. Not just planning and designing, but actually programming. So here I am procrastinating by starting a blog. Although my defence against temptation is weak, I figure that I can make good use of it. When my mind wanders, I can try to record my vagrant thoughts.

Not just that, but also I want to record some of my design decisions and some of my learning issues. Maybe even write some interesting code bits.

Here's to determination!