[PyQt] pyuic4 problem

William Kyngesburye woklist at kyngchaos.com
Fri Aug 6 02:06:53 BST 2010


By default, sip/pyqt executables (and the module binaries and other parts) install in the system python framework.  This is really not a good idea, as Apple can easily zap things, and as you've found the executables aren't found (the framework is not in the standard shell PATH), and there IS a standard user module path.

A better configuration method is (note also that with Qt Cocoa 4.6 you can compile 64bit):

SIP:

export MACOSX_DEPLOYMENT_TARGET=10.6
python2.6 configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch=i386 --arch=x86_64 -s MacOSX10.6.sdk
make
sudo make install

PyQt:

python2.6 configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin
make
sudo make install


To use your default system install, add /System/Library/Frameworks/Python.framework/Versions/2.6/bin to your PATH in the Terminal.

To clean up the system install, delete:

/System/Library/Frameworks/Python.framework/Versions/2.6/bin/pylupdate4, ptrcc4, pyuic4, sip
/System/Library/Frameworks/Python.framework/Versions/2.6/include/sip.h
/System/Library/Frameworks/Python.framework/Versions/2.6/share/sip
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/sip*, PyQt4


On Aug 5, 2010, at 7:36 PM, David Quinn wrote:

> I've successfully installed SIP and PyQt on a mac running snow leopard
> using the following commands (courtesy of http://www.expobrain.net/2010/06/22/install-pyqt4-in-snow-leopard):
> Within SIP
> $ export MACOSX_DEPLOYMENT_TARGET=10.6
> $ python configure.py -n  --arch=i386 -s MacOSX10.6.sdk
> $ make
> $ sudo make install
> 
> Within PyQt4:
> 
> $ export QTDIR=/Developer/Applications/Qt
> $ python configure.py --use-arch=i386
> $ make
> $ sudo make install
> 
> When I run Python, I can import PyQt4. However pyuic4 is not installed as far as I can tell as I get the error message:
> 
> -bash: pyuic4: command not found
> 
> when I try to convert a .ui into a .py file. 
> 
> I edited my .bash_profile as I previously had another version of Python and this is what it currently is:
> 
> # set path to be default mac python (2.6)
> PATH="/Library/usr/bin/python:${PATH}"
> export PATH
> 
> test -r /sw/bin/init.sh && . /sw/bin/init.sh
> 
> # The orginal version is saved in .bash_profile.pysave
> PYTHONPATH="/Users/david/Apps/PyQt-4.7.3:${PYTHONPATH}"
> export PYTHONPATH
> 
> # Setting PATH for MacPython
> # The orginal version is saved in .bash_profile.pysave
> PYTHONPATH="/Users/david/Dropbox/qgis_scratch:${PYTHONPATH}"
> export PYTHONPATH
> 
> Do I need to change a path setting for pyuic4 to work? I previously had pyuic4 and PyQt working on Python 2.5 before reinstalling everything on python 2.6.1
> 
> David
> 
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the past isn't a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?"

- The Ruler of the Universe




More information about the PyQt mailing list