使用Qt写了个窗口,运行报错,无法正常运行python程序,获得的报错信息如下:

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

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)的更多相关文章

  1. [报错] Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

    今天下午做python的作业,我用PyQt5 中 利用QWebEngineView打开外部网页. 但是一直闪退,一运行就闪退. 显示报错:Process finished with exit code ...

  2. tensorflow Process finished with exit code 137 (interrupted by signal 9: SIGKILL) 错误

    Process finished with exit code 137 (interrupted by signal 9: SIGKILL) 在使用tensorflow自带的数据集做手写数字识别的时候 ...

  3. Pycharm出现Segmentation fault...(interrupted by signal 11: SIGSEGV)的解决方法

    众所周知,用pycharm远程服务器debug代码已经成为学习深度学习相关代码的有力工具,但是最近创建了一个虚拟环境,进行debug的时候,莫名会出现下面这个错误,看的我都抽风了 bash: line ...

  4. cordova Process finished with exit code -1

    安装完cordova之后,创建一个测试项目后,运行报Process finished with exit code -1,经过查找原因,是因为gradle没有安装,在http://www.androi ...

  5. [idea] - 项目启动报错Process finished with exit code 1

    今天运行项目发现一个bug, "C:\Program Files\Java\jdk1.8.0_191\bin\java.exe" -XX:TieredStopAtLevel=1 - ...

  6. pycharm Process finished with exit code (0xC0000005)

    pycharm  Process finished with exit code  (0xC0000005)解决办法 上次报过这个错误,是在安装浏览器时发现的,报过同样的错误.按当时的方法,以为切地解 ...

  7. pycharm 出现Process finished with exit code 0 或 Process finished with exit code -1

    Process finished with exit code 0 意味着你的程序正常执行完毕并退出. 可以科普一下exit code,在大部分编程语言中都适用: exit code 0 表示程序执行 ...

  8. Android-AndroidStudio-AVD启动不了-emulator: Process finished with exit code 1

    注意:解决此错误目前只针对Windows系统的电脑: 1.AndroidStudio-->AVDManager(Create Virtual Device): 2.提示AVD启动不了,同时Eve ...

  9. spring boot 运行提示:Process finished with exit code 1

    spring boot 运行提示:Process finished with exit code 1 经检查发现是由于在application.properties配置文件中将某些自定义配置项移除了, ...

随机推荐

  1. SpringBoot-配置文件相关(五)

    SpringBoot-配置文件 SpringBoot官方文档 配置相关 SpringBoot使用一个全局的配置文件 , 配置文件名称是固定的 application.properties 语法结构 : ...

  2. POJ 3281 Dining(网络流-拆点)

    Cows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will c ...

  3. CSU-2018

    The gaming company Sandstorm is developing an online two player game. You have been asked to impleme ...

  4. 这个Python爬虫的简单入门及实用的实例,你会吗?

    前言本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理.作者:HOT_and_COOl 利用爬虫可以进行数据挖掘,比如可以爬取别人的网 ...

  5. koa安装教程

    此安装是在windows下进行 1.全局安装 npm install -g koa-generator 安装成功后会出现以下信息 创建项目 koa2 -e koa2-learn 2.1 -e指的是使用 ...

  6. [Python]实现字符串倒序的三种方法

    a=" 1: print(a[::-1]) 2: b=list(a) b.reverse() print(''.join(b)) 3: c=len(a)-1 str_1=[] while(c ...

  7. webpack前期了解

    webpack的核心概念(四个) 入口(entry) 输出(output) loader 插件(plugins) Entry(入口)——指示 webpack 应该使用哪个模块,来作为构建其内部依赖图的 ...

  8. hdu 2955 Robberies (01背包好题)

    Robberies Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  9. idea 几个常用的设置

    一.主题的背景

  10. 【Java必修课】好用的Arrays.asList也有这三个坑

    好用的asList 在开发或写测试用例的过程中,经常会用到Arrays.asList()这个方法,可以快速方便地将数组转化成一个List.例如: List<String> list = A ...