glue-viz / glue-vispy-viewers

3-d data viewers for glue based on VisPy
http://glueviz.org/en/stable/whatsnew/experimental_3d.html#experimental-3d
BSD 2-Clause "Simplified" License
25 stars 21 forks source link

Issues with Qt imports #269

Open astrofrog opened 6 years ago

astrofrog commented 6 years ago

There have been several bug reports with the following tracebacks:

Traceback (most recent call last):

File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/app/qt/mdi_area.py", line 61, in dropEvent
  new_layer(layer)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/app/qt/mdi_area.py", line 51, in new_layer
  self._application.choose_new_data_viewer(layer)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/app/qt/application.py", line 754, in choose_new_data_viewer
  return self.do(cmd)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/application_base.py", line 218, in do
  self._cmds.do(command)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/command.py", line 126, in do
  result = cmd.do(self._session)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/command.py", line 216, in do
  v = session.application.new_data_viewer(self.viewer, self.data)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/utils/matplotlib.py", line 158, in wrapper
  result = func(*args, **kwargs)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/application_base.py", line 82, in new_data_viewer
  c = viewer_class(self._session)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/viewers/common/qt/data_viewer.py", line 29, in __call__
  obj = type.__call__(cls, *args, **kwargs)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/common/vispy_data_viewer.py", line 57, in __init__
  self._vispy_widget = VispyWidgetHelper(viewer_state=self.state)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/common/vispy_widget.py", line 27, in __init__
  bgcolor=rgb(settings.BACKGROUND_COLOR))
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/scene/canvas.py", line 136, in __init__
  always_on_top, px_scale)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/canvas.py", line 169, in __init__
  self._app = use_app(call_reuse=False)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/_default_app.py", line 47, in use_app
  default_app = Application(backend_name)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/application.py", line 49, in __init__
  self._use(backend_name)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/application.py", line 211, in _use
  __import__(mod_name, globals(), level=1)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/backends/_pyqt5.py", line 39, in <module>
  from . import _qt  # noqa
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/backends/_qt.py", line 87, in <module>
  from PyQt5 import QtGui, QtCore, QtWidgets, QtTest
ImportError: cannot import name QtTest Traceback (most recent call last):

File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/app/qt/mdi_area.py", line 61, in dropEvent
  new_layer(layer)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/app/qt/mdi_area.py", line 51, in new_layer
  self._application.choose_new_data_viewer(layer)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/app/qt/application.py", line 754, in choose_new_data_viewer
  return self.do(cmd)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/application_base.py", line 218, in do
  self._cmds.do(command)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/command.py", line 126, in do
  result = cmd.do(self._session)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/command.py", line 216, in do
  v = session.application.new_data_viewer(self.viewer, self.data)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/utils/matplotlib.py", line 158, in wrapper
  result = func(*args, **kwargs)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/core/application_base.py", line 82, in new_data_viewer
  c = viewer_class(self._session)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue/viewers/common/qt/data_viewer.py", line 29, in __call__
  obj = type.__call__(cls, *args, **kwargs)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/common/vispy_data_viewer.py", line 57, in __init__
  self._vispy_widget = VispyWidgetHelper(viewer_state=self.state)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/common/vispy_widget.py", line 27, in __init__
  bgcolor=rgb(settings.BACKGROUND_COLOR))
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/scene/canvas.py", line 136, in __init__
  always_on_top, px_scale)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/canvas.py", line 169, in __init__
  self._app = use_app(call_reuse=False)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/_default_app.py", line 47, in use_app
  default_app = Application(backend_name)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/application.py", line 49, in __init__
  self._use(backend_name)
File "/Users/xujingping/anaconda2/lib/python2.7/site-packages/glue_vispy_viewers/extern/vispy/app/application.py", line 241, in _use
  self._backend = self.backend_module.ApplicationBackend()
AttributeError: ‘module’ object has no attribute ‘ApplicationBackend’
ltlancas commented 6 years ago

I am finding this as an issue, I get this every time I try to make a 3D plot with my data. Any update on what's wrong?

astrofrog commented 6 years ago

@ltlancas - did you install glue with conda? If so, could you send me the output of conda list and let me know what operating system you are using?

astrofrog commented 6 years ago

@ltlancas - I saw this on someone's laptop today and we fixed it by updating Qt to the latest version using:

conda install pyqt

Does this help in your case?