Discussion:
pyqtgraph plot() with forced PySide causes Python to crash
Daniel Galtieri
2014-08-14 19:07:09 UTC
Permalink
So, info from pg.systemInfo() first:

sys.version: 3.4.1 |Anaconda 2.0.1 (64-bit)| (default, Jun 11 2014,
17:27:11) [MSC v.1600 64 bit (AMD64)]
qt bindings: PyQt4 4.10.4 Qt 4.8.6
pyqtgraph: 0.9.8; None
config:
{'antialias': False,
'background': (0, 0, 0),
'editorCommand': None,
'enableExperimental': False,
'exitCleanup': True,
'foreground': (150, 150, 150),
'leftButtonPan': True,
'useOpenGL': False,
'useWeave': False,
'weaveDebug': False}

I'm just learning to build QT apps in Python, and have been using PySide
primarily.

If I do something trivial, such as

pg.plot(x=[1,2,3], y=[1,2,3])

this works fine if I do not force PySide bindings. However, if I import
PySide first Python crashes when the plot window goes to be generated.

I still get an output such as:

pyqtgraph.graphicsWindows.PlotWindow object at 0x00000000058068C8

but the window that pops up where the plot is drawn to is blank and "Not
Responding"

Not sure if this is a PySide thing or what.

Oddly enough, I have the same problem when I'm working in the PyCharm
console, regardless of whether or not PySide has been imported (the tests
when it works were all done in the cmd window or powershell)
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/fa7239ff-dc00-4b23-93a9-cb500df689cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Daniel Galtieri
2014-08-14 19:17:29 UTC
Permalink
This happens also when I am in the ipython notebook, again regardless of
whether or not I have imported PySide first

It does not happen in PyCharm if I'm working in the PyCharm terminal, only
in the console (unless PySide is imported first, in which case it always
happens).

It does not happen in ipython just working with the cmd line, again unless
PySide is imported first.

So to summarize:

Always happens when PySide was imported first
Happens in PyCharm console and IPython Notebook, even if PySide was not
imported
Does not happen in terminal (PyCharm) or cmd line as long as Pyside was NOT
imported first.
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/68b50a37-da6c-4362-ab75-878af4ff506d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luke Campagnola
2014-08-15 03:39:07 UTC
Permalink
Post by Daniel Galtieri
this works fine if I do not force PySide bindings. However, if I import
PySide first Python crashes when the plot window goes to be generated.
pyqtgraph.graphicsWindows.PlotWindow object at 0x00000000058068C8
but the window that pops up where the plot is drawn to is blank and "Not
Responding"
The essential issue here is that something in python needs to be processing
Qt events, or you will end up with a frozen window. PyQt uses python's
input hook to make periodic calls to QApplication.processEvents() while the
console is waiting for input, but PySide lacks this feature. Different IDEs
will vary in their ability to handle Qt events, so for each one you should
research what is required to make PyQt / PySide work with that IDE. If you
are ok with hanging your console, you can always call QApplication.exec_()
to start Qt's event loop.
--
You received this message because you are subscribed to the Google Groups "pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyqtgraph+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/CACZXET8uCa-4hSsbXwDoAzeJh7ADeXQnHppWun8q%3D8Lp9Hqv9A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...