gphoton-tools / ggui

gPhoton glue user interface.
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Error if qt import not done first. #7

Closed scfleming closed 7 years ago

scfleming commented 7 years ago

Get this odd error, from a google search seems to be an issue with import order. I avoid this if the qt import comes first in config.py, suggest doing that?

ValueError: ("Error loading config file /Users/fleming/Work/GALEX/gPhoton/gphoton-tools/ggui/config.py:\nAPI 'QDate' has already been set to version 1"

Putting this line at the top of the config.py, rather than last, avoids the issue: rom qtpy.QtWidgets import QFileDialog

duytnguyendtn commented 7 years ago

Hmm... I can't reproduce this error, and my googling skills are not working for me right now. I'm going to implement the change, but leave this open. @scfleming Could you post any references you find on this issue? I'd like to learn more about this.

scfleming commented 7 years ago

I haven't found a specific example, it seems to be based upon what other imports due to Qt environment, almost certainly this is different for me than you based upon how other Python libraries are automatically imported, etc.

One answer maybe here: https://gis.stackexchange.com/questions/234575/error-inside-pyinstaller-app-with-pyqgis-pyqt4-on-windows

For me, I get this if I import the Qt line 2nd (after glue.core) whereas if I do it before I don't get the error. Not satisfactory, but recommendation is to probably import the Qt line first and re-visit if any users enounter a problem with it....

scfleming commented 7 years ago

Just downloaded recent master branch and works fine.