【问题标题】:PyImport_ImportModule("PyQt4.QtGui") failsPyImport_ImportModule("PyQt4.QtGui") 失败
【发布时间】:2010-05-11 15:26:50
【问题描述】:

我有一个 C++ windows 应用程序正在尝试加载 PyQt4 对象,类似于 PyQt4 在 QtDesigner 中提供 python 小部件的方式。该应用程序可以很好地加载其他 Python 模块,但无法加载 PyQt4.QtGui。此外,使用直接的 Python,我可以很好地加载 PyQt4.QtGui。尝试时的调试输出是:

'devenv.exe': Loaded 'C:\Python26\Lib\site-packages\PyQt4\QtGui.pyd', Binary was not built with debug information.
'devenv.exe': Loaded 'C:\Qt\4.6.2\bin\QtCore4.dll', Binary was not built with debug information.
First-chance exception at 0x77747e52 in devenv.exe: 0xC0000139: Entry Point Not Found.
'devenv.exe': Unloaded 'C:\Python26\Lib\site-packages\PyQt4\QtGui.pyd'
'devenv.exe': Unloaded 'C:\Qt\4.6.2\bin\QtCore4.dll'

看起来它试图在 QtCore4.dll 之后加载另一个模块,但失败了。任何想法为什么会发生这种情况?

【问题讨论】:

    标签: python pyqt4


    【解决方案1】:

    经过一番调查,似乎我的 C++ 应用程序正在使用一次安装的 Qt 中的 Qt dll,而 Python 正在尝试加载不同的 Qt dll - 与 PyQt 一起安装的那些。我怀疑发生故障是因为同一个进程正在尝试两个几乎相同的 dll。

    【讨论】:

      猜你喜欢
      • 2016-05-16
      • 2018-09-11
      • 2011-02-13
      • 1970-01-01
      • 2014-01-12
      • 2018-01-15
      • 1970-01-01
      相关资源
      最近更新 更多