PyQt5脚本在模块StackHash中出现错误BEX

时间:2016-10-21 13:42:52

标签: python pyqt5

我使用PyQt5在Python 3.5中编写脚本,2我的同事无法运行它 - 他们收到错误:

Problem signature:
  Problem Event Name:                    BEX
  Application Name:                      python.exe
  Application Version:                   3.5.1150.1013
  Application Timestamp:                 566391f0
  Fault Module Name:                     StackHash_0a9e
  Fault Module Version:                  0.0.0.0
  Fault Module Timestamp:                00000000
  Exception Offset:                      00000000
  Exception Code:                        c0000005
  Exception Data:                        00000008
  OS Version:                            6.1.7601.2.1.0.256.4
  Locale ID:                             1029
  Additional Information 1:              0a9e
  Additional Information 2:              0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:              0a9e
  Additional Information 4:              0a9e372d3b4ad19135b953a78882e789

当脚本首先执行Qt功能时:

app = QtWidgets.QApplication(sys.argv)

1 个答案:

答案 0 :(得分:0)

不幸的是我的电脑上没有错误,所以我无法重现。但我的同事找到了解决方案。 他需要清理进口。最初我导入了2个类似的包:

from PyQt5.QtGui import QTextCursor, QFont
from PyQt5.Qt import QTextCursor, QFont

当我的同事评论第二行时,问题就解决了:

from PyQt5.QtGui import QTextCursor, QFont
#from PyQt5.Qt import QTextCursor, QFont

因此,如果您有类似错误的报告,请尝试清理您的导入......