PyQt5 脚本在 StackHash 模块中出现错误 BEX [英] PyQt5 script got error BEX in module StackHash

查看:52
本文介绍了PyQt5 脚本在 StackHash 模块中出现错误 BEX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I wrote script in Python 3.5 using PyQt5 and 2 my colleagues could not run it - they got error:

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 函数时:

When script executed first Qt function:

app = QtWidgets.QApplication(sys.argv)

推荐答案

很遗憾,我的 PC 上没有错误,因此无法重现.但是我的同事找到了解决方案.他需要清理进口.最初我导入了2个类似的包:

Unfortunately I do not have error on my PC so I could not reproduce. But my colleague found a solution. He need to clean up imports. Originally I imported 2 similar packages:

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

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

And issue was fixed when my colleague commented second line:

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

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

So if ever you got report of similar error try to clean up your imports...

这篇关于PyQt5 脚本在 StackHash 模块中出现错误 BEX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆