In article
<5c6...@ma...>,
David Eppstein <dav...@gm...> wrote:
> This is probably not about PyObjC at all, but maybe someone here knows
> enough about Python under OS X to answer it. A friend of mine is using
> EasyDialogs and his code broke under Snow Leopard. If one tries to
> import EasyDialogs in the default Python installation, one gets the
> error
>
> >>> import EasyDialogs
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File
> "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat
> -mac/EasyDialogs.py",
> line 24, in <module>
> from Carbon.Dlg import GetNewDialog, SetDialogItemText,
> GetDialogItemText, ModalDialog
> ImportError: cannot import name GetNewDialog
> >>>
>
> Is there any fix, workaround, or alternative library?
A better place to ask a question like this would be on the Python Mac
SIG forum (http://dir.gmane.org/gmane.comp.python.apple). The problem
is that the Apple-supplied Python 2.6 in 10.6 runs by default in 64-bit
mode and the old Mac Carbon modules are not available in 64-bit mode
since Apple chose not to support 64-bit Carbon. That's why those old
Mac modules are deprecated in Python 2.6 and removed in Python 3. A
workaround is to force Python to run in 32-bit mode:
$ arch -i386 /usr/bin/python2.6
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import EasyDialogs
>>>
or
$ export VERSIONER_PYTHON_PREFER_32_BIT=yes
$ /usr/bin/python
--
Ned Deily,
na...@ac...
|