-
Notifications
You must be signed in to change notification settings - Fork 2
Description
I am not able to get the latest pyncview-git (https://github.com/BoldingBruggeman/pyncview) work together with the latest GOTM/code/gui (https://github.com/gotm-model/code)
For example:
python multiplot.py -s INFILE –e VARIABLE
gives: “cannot import name QtWidgets”
The error message is from multiplot.py
“ def plot(self,startmessageloop=True):
gui = self.output is None
if gui:
# We have to show figure in GUI.
# Import PyQt libraries if not doen already.
global QtWidgets
if QtWidgets is None:
from xmlstore.qt_compat import QtWidgets
“
To me, it seems like that module QtWidgets does not exist in:
GOTM/gotm-code/gui.py/xmlstore/qt_compat.py
Required paths are defined as export
GOTMDIR=HOME/GOTM/gotm-code
export PYTHONPATH=HOME/GOTM/gotm-code/gui.py
In multiplot.py, I have tried to shift from PyQt4 to PyQt5 and use
from PyQt5 import QtWidgets
instead, but since the xmlplot-dir use PyQt4, it is not a possible way forward
I have also tried to import the module in an ipython-environment:
ipython: from xmlstore.qt_compat import QtWidgets
In [1]: from xmlstore.qt_compat import QtWidgets
ImportError Traceback (most recent call last)
in ()
----> 1 from xmlstore.qt_compat import QtWidgets
ImportError: cannot import name QtWidgets
In [2]: import xmlstore.qt_compat
Thus, it is possible to import qt_compat but not the QtQidgets
It seems like older version of the pyncview-packages does not use QtWidgets.
In my older version of multiplot.py (def plot) use PyQt4-package instead:
“ global QtGui
from PyQt4 import QtGui”
Do you have any solution to get the pyncview package up and running?
/Johan Söderkvist
Defence Centre for Operational Oceanography (FCOO)
Denmark