Skip to content

Commit

Permalink
pyqtgraph < 0.10 fail to run (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada authored and Mike Lautman committed Dec 12, 2018
1 parent 549bbcb commit 1971bc4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/rqt_plot/data_plot/pyqtgraph_data_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@
def parse_version(s):
return [int(x) for x in re.sub(r'(\.0+)*$', '', s).split('.')]

from pyqtgraph import __version__ as pyqtgraph_version
try:
from pyqtgraph import __version__ as pyqtgraph_version
except RuntimeError:
# pyqtgraph < 1.0 using Qt4 failing on 16.04 because kinetic uses Qt5.
# This raises RuntimeError('the PyQt4.QtCore and PyQt5.QtCore modules both wrap the QObject class')
import pkg_resources
pyqtgraph_version = pkg_resources.get_distribution("pyqtgraph").version

if parse_version(pyqtgraph_version) < parse_version('0.10.0'):
raise ImportError('A newer PyQtGraph version is required (at least 0.10 for Qt 5)')

Expand Down

0 comments on commit 1971bc4

Please sign in to comment.