Skip to content

import all vs gui vs core #18

@jvail

Description

@jvail

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 *

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions