Pyqt installation issue on mac osx snow leopard

I follow the instructions for building desktop applications. with python and qt4, I downloaded and installed qt creator ide, created a .ui file, and then I had to convert it with pyuic4, I tried a lot of things and can't do it.

I thought pyuic4 would be installed with the Qt creator IDE, but it doesn't seem to be that way, so I installed pyqt through macports:

sudo port install py26-pyqt4 

I did not know, but it was with qt, so there were about 3 hours of its creation.

after installing it, I tried to convert .ui again:

 $ pyuic4-2.6 principal.ui -o prin.py Traceback (most recent call last): File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PyQt4/uic/pyuic.py", line 4, in <module> from PyQt4 import QtCore ImportError: No module named PyQt4 

No module named PyQt4? wasn’t what I just installed?

Thank you, and sorry if my English is not 100% good.

+4
source share
3 answers

I solved this, you need to use python from macports instead of the standard one that comes with OS X to complete the python_select installation via macports:

 sudo port install python_select sudo python_select python26 
+8
source

I took some notes on creating and installing PyQt4 on Mac Snow Leopard .

The order is important, and there are some quirks with 64-bit libraries. By default, Mac Qt libs are Carbon (32 bits), while the Python Mac system has 64 bits and needs Cocoa libs.

+3
source

I spent some time searching for the package name in Homebrew. It seems that:

 brew install pyqt 
0
source

All Articles