1

一段时间以来,我一直试图让 PyQt4 在我的 OSx 机器(10.8.5)上工作 - 我已经通过使用安装程序将它加载到我的 Windows 机器上,没有问题。

我使用自制软件在我的机器上加载了 sip 4.8.5、Python 2.7 Qt 4.8.5。

当我尝试在 WING 中调试以下文件时,出现以下错误:

来自 Zetcode 的代码作为测试

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()

例外:

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

为什么没有加载 Qt 库?我需要做什么才能加载库?谢谢,-j

4

2 回答 2

0

您可能需要将项目属性(从项目菜单)中的 Python 可执行文件设置为 /usr/local/bin/python - 或者安装 PyQt4 的 Python 中的任何 sys.executable 值。

请注意,在 Wing 101 中,这是在“配置 Python”对话框中完成的,该对话框可从“编辑”菜单访问。

于 2014-03-10T02:37:48.637 回答
0

我个人不使用自制软件,但我很确定它会在/usr/local. 从错误消息看来,它正在访问/Library/Frameworks/Python.framework. 我也不使用 WingIDE,但看起来它使用的 python 安装与您想要的不同。我确信有一种方法可以指定它使用哪个 python。

于 2014-03-10T01:28:33.033 回答