In article <89f50109-83f9-4c1e-8e0d-7f985b1c2...@xiao-yu.com>, Xiao Yu <x...@xiao-yu.com> wrote: > I have Snow Leopard and followed 4.6.1 snapshot 20091010's reference > 3.4 instructions to configure both SIP and PyQt in i386. Everything > installed fine but when I open Python and tried to import ImageQt, I > get the following error: > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/Library/Python/2.6/site-packages/PIL/ImageQt.py", line 20, > in <module> > from PyQt4.QtGui import QImage, qRgb > ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/QtGui.so, > 2): no suitable image found. Did find: > /Library/Python/2.6/site-packages/PyQt4/QtGui.so: mach-o, but wrong > architecture > > What am I still doing wrong? Is there a specific way I have to run > Python etc?
The Apple-supplied Python 2.6 in Snow Leopard runs by default in 64-bit mode. If the PyQt4 was only built for i386, i.e. 32-bit mode, try forcing Apple python to run in 32-mode by either setting an environment variable: # one-time VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/python # always in this session (or add to shell profile) export VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/python or you can use the defaults command to permanently prefer 32-bit. See Apple's python man page for details. -- Ned Deily, n...@acm.org -- http://mail.python.org/mailman/listinfo/python-list