Still wrong architecture on Snow Leopard

Ned Deily nad at
Tue Oct 13 10:23:20 CEST 2009

In article <89F50109-83F9-4C1E-8E0D-7F985B1C2292 at>,
 Xiao Yu <xiao at> 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/", line 20,  
> in <module>
>      from PyQt4.QtGui import QImage, qRgb
> ImportError: dlopen(/Library/Python/2.6/site-packages/PyQt4/,  
> 2): no suitable image found.  Did find:
> 	/Library/Python/2.6/site-packages/PyQt4/ 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 

# one-time
VERSIONER_PYTHON_PREFER_32_BIT=yes /usr/bin/python

# always in this session (or add to shell profile)

or you can use the defaults command to permanently prefer 32-bit.  See 
Apple's python man page for details.

 Ned Deily,
 nad at

More information about the Python-list mailing list