andrewherd.me

Technical Artist

Running PyQt4 Scripts on Snow Leopard

Calling python scripts from the terminal window run fine. But when running python scripts with PyQt4 embedded, they require a little more then just ‘python script.py’. This may be from the previous entry on how the PyQt4 was installed, but regardless this information has been gleaned from the internet:

arch -i386 python2.6 %pathToScript%

Without the arch -i386 flag for calling python it will throw an error:

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