On 25-jan-2006, at 7:27, Talin wrote:
> I've been stuggling with PyObjC lately, and I am having the hardest
> time just getting the simplest program to compile and run.
> I don't know whether or not some of my problems stem from my
> somewhat unusual Python installation, but I suspect that most of
> the problems I am seeing are unrelated. At the moment I have both
> the built-in Python 2.3 that comes with OS X, and I also have an up
> to date Python 2.4 which I installed via darwinports. Python
> modules that I install via easy_install tend to end up in /usr/
> local, whereas modules that I install via darwinports end up in /
> opt/local. Mostly, I just try to use easy_install as much as
> possible, and only use darwinports for things aren't able to be
> installed that way (like psycopg). This setup is a bit strange, but
> mostly seems to work - at least, I have no problems running
> Here are some of the problems that I am having:
> 1) Sourceforge package downloads via easy_install appear to be
> broken at the current time, so I'm having to install everything
> manually. When I execute "sudo easy_install pyobjc" I get "No META
> HTTP-EQUIV="refresh" found in Sourceforge page". I've tried
> updating setuptools with the -U option (force upgrade), but this
> doesn't seem to help.
> 2) I tried several of the pre-built installers for pyobjc, but I
> suspect that they may be putting packages in the wrong place. So I
> decided to build and install pyobjc manually. Well, I quickly
> learned that while the installer for pyobjc includes py2app, doing
> a manual install requires me to download and install all of the
> various py2app components separately, such as macholib, etc.
The correct version of py2app is included in the source archives of
PyObjC (in the source-deps directory).
BTW. You can install pyobjc from source using 'python setup.py
bdist_mpkg --open'. This will create a binary installer and open it
in Installer.app. I'd guess that this also works with darwinports
port of python.
> After several hours of head-scratching, downloading, installing,
> configuring, and re-installing, I had what I thought might be a
> working pyobjc installation. I created a simple "Hello World"
> project, and tried to build it. No luck.
> 3) When I first loaded the project, the "run" menu was ghosted.
> Turns out (after about 2 hours of googling, and finally calling up
> a mac friend on iChat) that this was because the code templates for
> creating a PyObjC project in XCode didn't create any executables. I
> added a custom executable by hand, using /usr/bin/env as described
> in the online docs.
The XCode templates assume a framework install of Python. I don't use
them myself and can't really help you with them.
> 4) However, the custom executable doesn't work very well - when I
> try to run it, it gives a "permission denied" error, because the
> application file produced by the build doesn't have execute
> permissions set. Moreover, each time I do a build, it resets the
> permission bits back to non-executable, so I have to manually do a
> chmod a+x after each build.
> 5) Doing manual chmod quickly gets tiresome, so I tried to find
> some method that would allow me to do it automatically. I decided
> add a RunScript that adds the execute perms. However, I am unable
> to do this because all of the "add build phase" menu items are
> grayed out. I suspect there is something strange about the targets
> created by the template.
> 6) Even doing a manual chmod, I had to add the PyRuntimeLocations
> to the info.plist manually so that it could find the frameworks.
> 7) After all this, I try to run the program, and it says it can't
> find PyObjCTools, and exits.
> Anyway, I think I've spent about two days wrestling with trying to
> get "hello world" to build and run, and so far I haven't managed
> even that. I'm particularly frustrated because of all of the PyObjC
> tutorials that claim how easy it is to create a project. :(
> Hoping you can help me out...
> -- Talin
> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD
> Pyobjc-dev mailing list