1

I've been trying to get PyQt4 to work on my OSx machine (10.8.5) for some time - I've loaded it on my windows machine with no problem by using an installer.

I have sip 4.8.5, Python 2.7 Qt 4.8.5 loaded on my machine using homebrew.

When I try to debug the following file in WING, I get the following error:

Code from Zetcode as a test

import sys
import QtGui


def main():

    app = QtGui.QApplication(sys.argv)

    w = QtGui.QWidget()
    w.resize(250, 150)
    w.move(300, 300)
    w.setWindowTitle('Simple')
    w.show()

    sys.exit(app.exec_())


if __name__ == '__main__':
    main()

Exception:

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/PyQt4/_qt.so, 2):
Library not loaded: QtDesigner.framework/Versions/4/QtDesigner
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/PyQt4/_qt.so
Reason: image not found

Why is the Qt library not loading? What do I need to do to get the library to load? Thanks, -j

djhoese
  • 3,567
  • 1
  • 27
  • 45
jyeiser
  • 11
  • 1

2 Answers2

0

I don't personally use homebrew, but I'm pretty sure it installs stuff in /usr/local. From the error message it looks like it is accessing /Library/Frameworks/Python.framework. I also don't use WingIDE, but it looks like it is using a different python install than you want it to. I'm sure there is a way to specify which python it uses.

djhoese
  • 3,567
  • 1
  • 27
  • 45
0

You probably need to set the Python Executable in Project Properties (from the Project menu) to /usr/local/bin/python -- or whatever the value of sys.executable is in the Python that has PyQt4 installed into it.

Note that in Wing 101 this is done in the Configure Python dialog instead, which is accessed from the Edit menu.

Wingware
  • 896
  • 5
  • 12