我正在尝试编译我的第一个使用 PyQt 的应用程序。它编译成功,但如果我尝试运行,它会说:
WindowsError: [Error 2] : 'C:/Users/GHOSTM~1/AppData/Local/Temp/_MEI8722\\icons'
它说原始错误在哪里。它在我设置图标的地方:
action = QtGui.QAction(QtGui.QIcon(':/data/%s' % icon), name, parent)
如您所见,我从资源模块导入图标,该图标是使用 qrc 文件中的 pyrcc4.exe 生成的。原始 qrc 文件包含这样的信息:
<RCC>
<qresource>
<file>../data/dictionary.png</file>
<file>../data/perseus.png</file>
<file>../data/settings.png</file>
<file>../data/help.png</file>
<file>../data/quit.png</file>
</qresource>
</RCC>
Python 模块生成成功,原始脚本运行良好。我做错了吗?