Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
2017-10-21 22:58
731 查看
使用Qt写了个窗口,运行报错,无法正常运行python程序,获得的报错信息如下:
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
经过仔细查看发现是在使用Qt模块导入了Qt4和Qt5两个模块(存在重合的部分),部分代码如下:
我尝试着去除Qt4和Qt5重合导入的模块,运行发现可以成功,自以为这就是失败的原因了,为了放心我又单独测试了一下导入Qt4,代码如下:
结果运行如下:
如此可以发现,不是由于重复导入模块而导致运行失败的,可以确认是由于Qt4模块自身出现了异常,猜测可能是由于sip导致Qt4模块的异常,然后发现我并没有PyQt4_gpl_x11,为了验证,我重新安装了PyQt4来验证,Ubuntu中安装配置过程如下:
1)安装sip
地址:http://www.riverbankcomputing.co.uk/software/sip/download
2)安装Qt4的依赖
3)安装PyQt4
重新运行,成功运行!!!
enjoytoday,enjoycoding
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
经过仔细查看发现是在使用Qt模块导入了Qt4和Qt5两个模块(存在重合的部分),部分代码如下:
//Qt5 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtGui import QFont, QBrush from PyQt5.QtWidgets import QTableWidget from PyQt4 import Qt //QT4 class Ui_TabWidget(object): def setupUi(self,TabWidget): TabWidget.setObjectName("TabWidget") TabWidget.resize(962, 618) self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.lineEdit = QtWidgets.QLineEdit(self.tab) self.lineEdit.setGeometry(QtCore.QRect(10, 20, 291, 31)) self.lineEdit.setObjectName("lineEdit") self.label = QtWidgets.QLabel(self.tab) self.label.setGeometry(QtCore.QRect(310, 30, 54, 21)) self.label.setObjectName("label") self.fontComboBox = QtWidgets.QFontComboBox(self.tab) self.fontComboBox.setGeometry(QtCore.QRect(350, 20, 161, 31)) self.fontComboBox.setObjectName("fontComboBox") self.pushButton = QtWidgets.QPushButton(self.tab) ......
我尝试着去除Qt4和Qt5重合导入的模块,运行发现可以成功,自以为这就是失败的原因了,为了放心我又单独测试了一下导入Qt4,代码如下:
# !/usr/bin/env python # -*- encoding:utf-8 -*- import sys from PyQt4 import QtCore, QtGui, QtWidgets if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) w = QtWidgets.QWidget() w.resize(250, 150) w.move(300, 300) w.setWindowTitle('helloworld') w.show() sys.exit(app.exec_())
结果运行如下:
/usr/bin/python2.7 ~/helloworld Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
如此可以发现,不是由于重复导入模块而导致运行失败的,可以确认是由于Qt4模块自身出现了异常,猜测可能是由于sip导致Qt4模块的异常,然后发现我并没有PyQt4_gpl_x11,为了验证,我重新安装了PyQt4来验证,Ubuntu中安装配置过程如下:
1)安装sip
地址:http://www.riverbankcomputing.co.uk/software/sip/download
cd sip-4.19.3/ sudo python configure.py sudo make install
2)安装Qt4的依赖
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos qt4-designer sudo apt-get install libqwt5-qt4 libqwt5-qt4-dev
3)安装PyQt4
cd PyQt4_gpl_x11-4.12.1 sudo python configure.py sudo make sudo make install
重新运行,成功运行!!!
enjoytoday,enjoycoding
相关文章推荐
- nodejs项目报Process finished with exit code 8错误
- Android Studio各种坑爹之:finished with non-zero exit value 1和Return code 1 for dex process.
- pycharm报错:Process finished with exit code -1073741819 (0xC0000005)
- process finished with exit code 52
- 运行代码后出现Process finished with exit code 0是为什么?
- Process finished with exit code -1073741819 (0xC0000005)
- python 使用requests时提示Process finished with exit code -1073741819 (0xC0000005)
- Python 运行出现Process finished with exit code -1073741515 (0xC0000135)错误
- pyCharm Process finished with exit code -1073740791 (0xC0000409)
- Python笔记——pyCharm错误: Process finished with exit code -1073740791 (0xC0000409)
- 运行tensorflow的例子,出现Process finished with exit code 3问题
- bug宝典node篇 nodejs Process finished with exit code 0
- Android Studio Emulator: Process finished with exit code 0错误
- cordova Process finished with exit code -1
- 运行nodejs项目报Process finished with exit code 1 错误
- android Process finished with exit code 0
- tensorflow 报错: Process finished with exit code -1073740791 (0xC0000409)
- Error:Execution failed for task ':inferentdemo:processDebugResources'. finished with non-zero exit v
- AS出现 Process 'command 'F:\java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1问题
- 安卓编译出错: Process 'command 'C:\Java\jdk1.8.0_51\bin\java.exe'' finished with non-zero exit value 1 解决!