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

Export to glue: no module named 'glue.app.qt' #926

Open
HealthyPear opened this issue Oct 18, 2024 · 3 comments · May be fixed by #927
Open

Export to glue: no module named 'glue.app.qt' #926

HealthyPear opened this issue Oct 18, 2024 · 3 comments · May be fixed by #927

Comments

@HealthyPear
Copy link

I installed glue on an arm64 machine but in a CONDA_SUBDIR=osx-64 environment.
I installed via pip resulting in

# Name                    Version                   Build  Channel
glue-core                 1.21.1                   pypi_0    pypi
glue-qt                   0.3.1                    pypi_0    pypi
glue-vispy-viewers        1.2.2                    pypi_0    pypi
glueviz                   1.3.0                    pypi_0    pypi
glue-qt                   0.3.1                    pypi_0    pypi
pyqt                      5.15.9          py312hd74d816_5    conda-forge
pyqt5-sip                 12.12.2         py312he36337a_5    conda-forge
qt-main                   5.15.8              h63f3aef_26    conda-forge
qtconsole                 5.6.0                    pypi_0    pypi
qtpy                      2.4.1                    pypi_0    pypi
spectral-cube             0.6.5                    pypi_0    pypi

as soon as I call the to_glue method I get this error

Traceback (most recent call last):
  File "/Users/michele/Software/3D_rendering_radio_data/test_glue.py", line 27, in <module>
    masked_slab.to_glue(name=None, glue_app=None, dataset=None, start_gui=True)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/michele/Software/miniforge3/envs/radio_3d_renderer_glue/lib/python3.13/site-packages/spectral_cube/spectral_cube.py", line 2427, in to_glue
    from glue.app.qt import GlueApplication
ModuleNotFoundError: No module named 'glue.app.qt'

I am instead able to launch glue alone

@HealthyPear
Copy link
Author

I fixed this by changing the import code in to_glue as below,

try:
    from glue.app.qt import GlueApplication
except ImportError: 
    from glue_qt.app.application import GlueApplication
from glue.core import DataCollection, Data
from glue.core.coordinates import coordinates_from_header
try:
    from glue.viewers.image.qt.data_viewer import ImageViewer
except ImportError:
    from glue_qt.viewers.image import ImageViewer
except ImportError:
    from glue.viewers.image.qt.viewer_widget import ImageWidget as ImageViewer

if you want I can open a PR.

@HealthyPear
Copy link
Author

I can't really make use of this because the only thing I need (iso surfaces) is not available (anymore) from there, but at least I manages to make it work.

@e-koch
Copy link
Contributor

e-koch commented Oct 18, 2024

thanks @HealthyPear! We'd appreciate you opening a PR.

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

Successfully merging a pull request may close this issue.

2 participants