Problem when both PyQt4 and PyQt5 installed.

34 views
Skip to first unread message

Okko Willeboordse

unread,
Jan 15, 2021, 10:53:00 AM1/15/21
to pyqtgraph
When both PyQt4 and PyQt5 are installed (in a transition phase) running pyqtgraph code results in an error (see stacktrace below) when PyQt4 is to be used by pyqtgraph.

This is because pyqtgraph uses PyQt5.sip instead of sip, see following code from the Qt module;

# Common to PyQt4 and 5
if QT_LIB in [PYQT4, PYQT5]:
    QtVersion = QtCore.QT_VERSION_STR
    
    try:
        from PyQt5 import sip
    except ImportError:
        import sip

If PyQt5 is present then PyQt5.sip is used even when PyQt4 is to be used.




Traceback (most recent call last):
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyqtgraph\graphicsItems\GraphicsObject.py", line 26, in itemChange
    self.parentChanged()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyqtgraph\graphicsItems\GraphicsItem.py", line 463, in parentChanged
    self._updateView()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyqtgraph\graphicsItems\GraphicsItem.py", line 480, in _updateView
    view = self.getViewBox()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyqtgraph\graphicsItems\GraphicsItem.py", line 88, in getViewBox
    vb = self.getViewWidget()
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyqtgraph\graphicsItems\GraphicsItem.py", line 65, in getViewWidget
    if v is not None and not isQObjectAlive(v):
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyqtgraph\Qt.py", line 328, in isQObjectAlive
    return not sip.isdeleted(obj)
TypeError: isdeleted() argument 1 must be sip.simplewrapper, not PenPLotter

Dennis Jensen

unread,
Jan 15, 2021, 12:33:47 PM1/15/21
to pyqt...@googlegroups.com
These should be done in stand alone environments as this kind of thing happens with many languages when you have a non-backwards compatible release. Separate you installations either onto 2 different machines or use Virtual Environments to keep them separated.

Virus-free. www.avast.com

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyqtgraph/4822fac5-cc10-45a8-9ffb-3f6a5aeec3a3n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages