Skip to content
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

import all vs gui vs core #18

Open
jvail opened this issue Sep 21, 2020 · 0 comments
Open

import all vs gui vs core #18

jvail opened this issue Sep 21, 2020 · 0 comments

Comments

@jvail
Copy link

jvail commented Sep 21, 2020

I get a strange error suddenly w/o having changed any lib in my conda env (as far as I recall):

~/git/jvail/plantgl/src/openalea/plantgl/all.py in <module>
      3 from .algo import *
      4 if not pgl_support_extension('PGL_NO_QT_GUI'):
----> 5     from .gui import *
      6 
      7 from . import codec

~/git/jvail/plantgl/src/openalea/plantgl/gui/__init__.py in <module>
      1 from ._pglgui import *
----> 2 from .qt.QtGui import QApplication
      3 
      4 #if QApplication.instance() is None:
      5 #    qPglApp =  QApplication([])

~/git/jvail/plantgl/src/openalea/plantgl/gui/qt/QtGui.py in <module>
     31     }
     32 elif os.environ[QT_API] in PYSIDE_API:
---> 33     from PySide.QtGui import *
     34     _tab_position = {
     35         0: QTabWidget.TabPosition.North,

ModuleNotFoundError: No module named 'PySide'

I think - in the long run - it would good to separate the Qt imports from the "plantgl core" imports. In jupyter I do not need any of the Qt stuff but e.g. LsystemWidget might throw an exception if any of the Qt stuff does not work (although it is not needed at all).
Maybe removing from .gui import * form all.py would help. Or maybe introducing an additional ns 'core'

from openalea.plantgl.core import *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant