simple test app - crash python on exit - pyside, windows, python 2.7

887 views
Skip to first unread message

mirmick

unread,
Jun 29, 2012, 5:16:52 AM6/29/12
to pyqt...@googlegroups.com
Hello

When running the following test code (based on "plot_widget" example) from the python command line, python crashes on exit

import sys
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
import pyqtgraph as pg

class Plotter(QtGui.QMainWindow):
    def __init__(self, parent=None):
        super(Plotter, self).__init__(parent)

        self.resize(800,800)
        cw = QtGui.QWidget()

        self.setCentralWidget(cw)
       
        l = QtGui.QVBoxLayout()
        cw.setLayout(l)

        pw = pg.PlotWidget(name='Plot1')  ## giving the plots names allows us to link their axes together
        l.addWidget(pw)

def main():
   
    app = QtGui.QApplication(sys.argv)
    form = Plotter()
    form.show()
    app.exec_()
   
if __name__ == "__main__":
    main()

Running the example "plot_widget" from the command seems ok
Any ideas what I am missing?

Thank you
Michael

Luke Campagnola

unread,
Jun 29, 2012, 7:50:57 AM6/29/12
to pyqt...@googlegroups.com
Hi Michael,
Your example works fine on my machine. Can you tell me:
  1. The pyqtgraph revision you are using (and whether you have modified it)
  2. Your OS
  3. Version of PyQt4 / PySide (look in PyQt4.QtCore.PYQT_VERSION_STR or PySide.__version__)

Thanks,
Luke

-- [ You are subscribed to pyqt...@googlegroups.com. To unsubscribe, send email to pyqtgraph+...@googlegroups.com ]

mirmick

unread,
Jun 29, 2012, 9:12:38 AM6/29/12
to pyqt...@googlegroups.com
Hi Luke

OS - Windows XP pro Ver 2002 SP 3,

python - Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32

pyqtgraph - downloaded yesterday, not modified - where do I get version?

PySide - PySide.__version__ '1.1.1'

Thank you
Regards
Michael

mirmick

unread,
Jun 29, 2012, 10:11:18 AM6/29/12
to pyqt...@googlegroups.com
Also may help in the command window I get "TypeErorr" when I run my code and supplied examples...

C:\ml>plot_widget.py
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable
TypeError: 'dict' object is not callable


plot_widget.py is "PlotWidget.py"

Thank you
Michael

Luke Campagnola

unread,
Jun 29, 2012, 3:23:42 PM6/29/12
to pyqt...@googlegroups.com
On Fri, Jun 29, 2012 at 9:12 AM, mirmick <mir...@indigo.ie> wrote:
OS - Windows XP pro Ver 2002 SP 3,

python - Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32

pyqtgraph - downloaded yesterday, not modified - where do I get version?

PySide - PySide.__version__ '1.1.1'


Ok, I've got an XP machine I can test on; I'll give it a try. 
Also, the 'TypeError' messages you see appear to be fixed (rather serendipitously) in the latest revision.

Luke

 

Luke Campagnola

unread,
Jul 3, 2012, 1:48:04 PM7/3/12
to pyqt...@googlegroups.com
I've had some time to look at this and have found that the crash is specific to PySide on both Windows and Linux. My recommendation at present is to try PyQt instead since it is a considerably more mature project. I will continue trying to find a workaround for the PySide bug, but we might just have to wait for a fix from the upstream developers.

Luke

Luke Campagnola

unread,
Jul 3, 2012, 2:49:40 PM7/3/12
to pyqt...@googlegroups.com
Strike that; I figured it out--PySide doesn't like it if the GraphicsScene is collected before the GraphicsView it is attached to. Latest revision has a workaround.

Luke

mirmick

unread,
Jul 4, 2012, 6:42:33 AM7/4/12
to pyqt...@googlegroups.com
Thank you - downloaded the update and all look good
Michael
Reply all
Reply to author
Forward
0 new messages