when install pyqt4, an error happen for "from pyqtgraph.Qt import QtWidgets"

140 views
Skip to first unread message

Deckard Zhang

unread,
Oct 30, 2018, 11:24:51 AM10/30/18
to pyqtgraph
when only install pyqtgraph, it is ok to run "from pyqtgraph.Qt import QtWidgets"
however, when I install pyqt4 together, an error happen when run "from pyqtgraph.Qt import QtWidgets"

ImportError: cannot import name QtWidgets


What's wrong? Thank you

Carlos Pascual

unread,
Oct 31, 2018, 3:50:24 AM10/31/18
to pyqt...@googlegroups.com, Deckard Zhang
QtWidgets was introduced in Qt5. See :
http://pyqt.sourceforge.net/Docs/PyQt5/pyqt4_differences.html#qtgui-module

If you are using PyQt4, you should import QtGui instead of QtWidgets
--
+----------------------------------------------------+
Carlos Pascual Izarra
Scientific Software Coordinator
Computing Division
ALBA Synchrotron [http://www.albasynchrotron.es]
Carrer de la Llum 2-26
E-08290 Cerdanyola del Valles (Barcelona), Spain
E-mail: cpas...@cells.es
Phone: +34 93 592 4428
+----------------------------------------------------+
Reply all
Reply to author
Forward
0 new messages