-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QtWidgets #1
Comments
Hi Johan
pyncview/multiplot:
Best is to install via pip - as described here:
https://github.com/BoldingBruggeman/pyncview
It seems you run a very old version of GOTM - you should update.
gotmgui:
If on Windows you'll also have to install the wheel from:
https://github.com/gotm-model/code/releases
If on Linux you'll have to compile your delf - use the CMake method.
Karsten
Den tor. 28. jun. 2018 kl. 10.41 skrev johansoderkvist <
[email protected]>:
… 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=/GOTM/gotm-code
export PYTHONPATH=/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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AKoOabIpccWMk39HWCIcyYrBtKojj5dXks5uBJbKgaJpZM4U6-pR>
.
--
Karsten Bolding
[email protected]
+4564422058
|
Dear Karsten Thank you for the tips. You are right about GOTM-version (I do not know how I mangaged to clone an old version though). Still, I run in to problems, a bit technichal though:
where lineargs is defined as: thus "'markersize': 6.0, " seems to me be a very OK value., I do not understand why multiplot-py-command gives Replacing
File "HOME/.local/lib/python2.7/site-packages/xmlplot/gui_qt4.py", line 360, in mouse_move So, something is missing in the object _xypress[0] In the old environment which works fine (same nc-file but not exact same zooming area) the print statement for self._xypress[0]) is: I hope that this information will be sufficient for you to pinpoint what is going on, and guide me to the next step! Best regards |
1: I'm afraid pyncview is only compatible with matplotlib up to 2.1.2 (not
2.2.2)
pip2 install matplotlib==2.1.2
2: maybe same a 1
I don't understand why you have to write pyncview.py - it should have been
installed into your path (the same folder as pip is in (*)) as pyncview -
try 'type pyncview'
if you have specified --user to pip remember to add ~/.local/bin to your
path
Den fre. 29. jun. 2018 kl. 14.31 skrev johansoderkvist <
[email protected]>:
… Dear Karsten
Thank you for the tips. You are right about GOTM-version (I do not know
how I mangaged to clone an old version though).
I have now downloaded and installed GOTM on linux as stated on:
http://gotm.net/software/linux/
I have installed pyncview, xmlplot and xmlstore with pip.
QtWidget-problem is gone! Thanks!
Still, I run in to problems, a bit technichal though:
1. multiplot.py:
multiplot.py -s INFILE -e VARIABLE
“type object got multiple values for keyword argument 'markersize'”
The error occur in
HOME/.local/lib/python2.7/site-packages/xmlplot/plot.py
axes.grid(True,**lineargs) # that is line 1999
where lineargs is defined as:
lineargs = getLineProperties(gridnode['LineProperties'])
Values of lineargs are:
{'color': (0.6901960784313725, 0.6901960784313725, 0.6901960784313725),
'markersize': 6.0, 'markeredgewidth': 0.5, 'markeredgecolor': (0.0, 0.0,
0.0), 'marker': u'', 'markerfacecolor': (0.6901960784313725,
0.6901960784313725, 0.6901960784313725), 'linewidth': 0.8, 'linestyle':
u'-'}
thus "'markersize': 6.0, " seems to me be a very OK value., I do not
understand why multiplot-py-command gives
“type object got multiple values for keyword argument 'markersize'”
Replacing
axes.grid(True,**lineargs)
with
axes.grid(True)
results in a nice image.
1. pyncview.py
I can view image using pyncview. However zooming gives errors:
File "HOME/.local/lib/python2.7/site-packages/xmlplot/gui_qt4.py", line
360, in mouse_move
lastx, lasty, a, ind, lim, trans= self._xypress[0]
ValueError: need more than 5 values to unpack
So, something is missing in the object _xypress[0]
print self._xypress[0] (gives)
(174, 143.0, <matplotlib.axes._subplots.AxesSubplot object at
0x7f8f2c9d0210>, 0, (735964.0, 736329.9930555555, -0.4382813550207892,
2.5572712728477165))
In the old environment which works fine (same nc-file but not exact same
zooming area) the print statement for self._xypress[0]) is:
"
(191, 386.0, <matplotlib.axes.AxesSubplot object at 0x3671bd0>, 0,
Bbox(array([[ 7.35964000e+05, -5.00000000e-01],
[ 7.36329993e+05, 2.50000000e+00]])), Affine2D(array([[ 1.58814489e+00,
0.00000000e+00, -1.16872371e+06],
[ 0.00000000e+00, 2.00000000e+02, 1.75000000e+02],
[ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]])))
I hope that this information will be sufficient for you to pinpoint what
is going on, and guide me to the next step!
Best regards
Johan
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKoOacZ2XifPXk7Fw1reGQUkjjZeRkwjks5uBh45gaJpZM4U6-pR>
.
--
Karsten Bolding
[email protected]
+4564422058
|
current version of matplotlib is 2.1.1, so that should not be a problem Thanks for tip on pyncview |
the tips for pyncview is also valid for multiplot - i.e. don't use
multiplot.py - just multiplot
and be sure to have the latest versions
Den man. 2. jul. 2018 kl. 10.21 skrev johansoderkvist <
[email protected]>:
… current version of matplotlib is 2.1.1, so that should not be a problem
Thanks for tip on pyncview
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKoOaY4CpUvGT9UgqDKRe7HSbxDrcFiIks5uCdgfgaJpZM4U6-pR>
.
--
Karsten Bolding
[email protected]
+4564422058
|
I have downloaded and installed GOTM and pyncview. Still, not able to use multiplot: pyncview works fine, until I try to zoom or choosing specific coordinate (thus not 2D-plot) /Johan Söderkvist |
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
“
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
The text was updated successfully, but these errors were encountered: