[Pythonmac-SIG] PyQt 3.8.1 on MacOS X 10.1 hobbles
Jack Jansen
Jack.Jansen at cwi.nl
Mon Nov 10 05:46:00 EST 2003
On 9 Nov 2003, at 14:06, Markus Biermaier wrote:
> I think PyQt for the Mac is not yet official supported. Also Sip is
> pre-release (pre3). I contacted Phil Thompson the person behind PyQt
> (I think) with this problem and he told me only to ask the list.
> I forgot to mention that I use Python-2.3.2.
>
>> If you don't run a python script from an executable bundle, it won't
>> be able to do GUI stuff (unless it calls undocumented private Apple
>> APIs), so that may have something to do with the problem you're
>> seeing. You might have a pythonw script that will do this, but you
>> don't mention which version of Python you are using.
>
> I find it cool to call a python script simply with "open *.py" from
> the shell. It DOES GUI stuff. I think the "open" program is a clever
> Apple program and does perhaps "undocumented private Apple APIs"!?
If you've built Python 2.3.2 with --enable-framework then "open
file.py" will open file.py with the PythonLauncher helper program,
which will in turn run "pythonw" to run your script. So then everything
should be okay, as far as the GUI stuff is concerned.
Which means that (if the above paragraph holds for you) the problem is
elsewhere. I would second Bob's suggestion to move to 10.2, because
that's the standard OSX version right now, so any PyQt and Qt
development will in all likelyhood have been done on that platform.
The fact that changing the order of imports makes the problem disappear
seems to point in the direction of something fishy going on in the area
of dynamic linking. The OSX model of dynamic linking is different from
what many unixen provide, and there are some tricks that packages with
a unix background used that needed some massaging to port to MacOSX.
Moreover, this sort of massaging tended to break between 10.1 and 10.2.
As an example, some package (wxPython, I think, but I'm not sure) had a
dynamic module A that exported a symbol Asym. A subsequently loaded
dynamic module B would then link to this symbol Asym. This will not
work on 10.2 and later without various linker flags, and Apple
discourages uses of those flags.
If you run the script with "pythonw -v" you'll see the modules being
imported. This may help you pinpoint the exact module that needs to be
loaded before anything else, which may indicate where the problem is.
If you need more help from the mailing list then you should probably
post the full stacktrace, plus the output of the build process of PyQt
(since it'll allow us to inspect the linker flags used). But again,
unless you move to at least 10.2 few people here will be able to
reproduce what you do.
--
Jack Jansen <Jack.Jansen at cwi.nl> http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
Goldman
More information about the Pythonmac-SIG
mailing list