Closed samrose30 closed 3 months ago
What version of jdaviz are you seeing this? The upcoming release of jdaviz will require astropy 6.0+, but maybe there is something that we need to backport as a bugfix to jdaviz 3.10.x that slipped by. (And while you're at it, can you please update the issue description with all the versions of python packages listed above so we can try to reproduce and track down what's happening?) Thanks!
Using jdaviz 3.10.3, software packages updated above, thanks!
@samrose30 , can you please upgrade spectral-cube ?
pip install spectral-cube -U
after updating spectral cube from 0.6.0 to 0.6.5 the same traceback error appears when trying to import jdaviz
The offending code was removed last year in https://github.com/radio-astro-tools/spectral-cube/pull/891 (released in v0.6.3). So it is quite impossible to get that traceback in 0.6.5. Did you restart your Python session and so on?
Also for completeness, Jdaviz does not use spectral-cube but glue pulls it in anyway, hence the trouble of us unable to pin it directly.
Related:
ImportError Traceback (most recent call last) Cell In[1], line 1 ----> 1 from jdaviz import Cubeviz
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/jdaviz/init.py:15 12 test = TestRunner.make_test_runner_in(os.path.dirname(file)) 14 # Top-level API as exposed to users. ---> 15 from jdaviz.app import * # noqa: F401, F403 16 from jdaviz.configs.specviz import Specviz # noqa: F401 17 from jdaviz.configs.specviz2d import Specviz2d # noqa: F401
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/jdaviz/app.py:31 29 from glue.core.units import unit_converter 30 from glue_astronomy.spectral_coordinates import SpectralCoordinates ---> 31 from glue_astronomy.translators.regions import roi_subset_state_to_region 32 from glue_jupyter.app import JupyterApplication 33 from glue_jupyter.common.toolbar_vuetify import read_icon
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/glue_astronomy/translators/init.py:3 1 from . import nddata # noqa 2 from . import regions # noqa ----> 3 from . import spectral_cube # noqa 4 from . import spectrum1d # noqa 5 from . import trace # noqa
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/glue_astronomy/translators/spectral_cube.py:9 6 from astropy import units as u 7 from astropy.wcs import WCSSUB_STOKES, WCS ----> 9 from spectral_cube import BooleanArrayMask 10 from spectral_cube.spectral_cube import (BaseSpectralCube, SpectralCube, 11 VaryingResolutionSpectralCube) 12 from spectral_cube.dask_spectral_cube import DaskSpectralCube, DaskVaryingResolutionSpectralCube
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/spectral_cube/init.py:5 1 # Licensed under a 3-clause BSD style license - see LICENSE.rst 3 from ._astropy_init import version, test ----> 5 from .spectral_cube import (SpectralCube, VaryingResolutionSpectralCube) 6 from .dask_spectral_cube import (DaskSpectralCube, DaskVaryingResolutionSpectralCube) 7 from .stokes_spectral_cube import StokesSpectralCube
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/spectral_cube/spectral_cube.py:33 29 from astropy.io.registry import UnifiedReadWriteMethod 31 import numpy as np ---> 33 from radio_beam import Beam, Beams 35 from . import cube_utils 36 from . import wcs_utils
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/radio_beam/init.py:3 1 # Licensed under a 3-clause BSD style license - see LICENSE.rst ----> 3 from ._astropy_init import version, test 5 from pkg_resources import get_distribution, DistributionNotFound 7 from .beam import (Beam, EllipticalGaussian2DKernel, 8 EllipticalTophat2DKernel)
File ~/opt/anaconda3/envs/webb/lib/python3.10/site-packages/radio_beam/_astropy_init.py:21 19 import os 20 from warnings import warn ---> 21 from astropy.config.configuration import ( 22 update_default_config, 23 ConfigurationDefaultMissingError, 24 ConfigurationDefaultMissingWarning) 26 # Create the test function for self test 27 from astropy.tests.runner import TestRunner
ImportError: cannot import name 'update_default_config' from 'astropy.config.configuration' (/Users/samrose/opt/anaconda3/envs/webb/lib/python3.10/site-packages/astropy/config/configuration.py)
After restarting python session, it is a different traceback
Ah, that is from yet another package we don't need but got pulled in by glue-astronomy. Please update this too.
pip install radio-beam -U
0.3.4 to 0.3.7 and that fixes it, thanks!
Good to hear. Thanks for letting us know!
Jdaviz component
Cubeviz
Description
Cubeviz fails to import for astropy version 6.1.2 Can get it to work for astropy version 5.3.4 Seems to be an inssue within spectral_cube
How to Reproduce
See below the traceback error when importing cubeviz.
Expected behavior
No response
Browser
No response
Jupyter
jupyter --version IPython : 8.10.0 ipykernel : 6.21.2 ipywidgets : 8.1.3 jupyter_client : 7.4.1 jupyter_core : 5.2.0 jupyter_server : 1.23.6 jupyterlab : 3.6.1 nbclient : 0.7.2 nbconvert : 7.2.9 nbformat : 5.7.3 notebook : 6.5.2 qtconsole : 5.4.1 traitlets : 5.9.0
Software versions
macOS-10.16-x86_64-i386-64bit Python 3.10.9 (main, Jan 11 2023, 09:18:20) [Clang 14.0.6 ] Numpy 1.25.2 astropy 6.1.2 matplotlib 3.7.0 scipy 1.9.3 scikit-image 0.24.0 asdf 3.2.0 stdatamodels 2.0.0 gwcs 0.21.0 regions 0.7 specutils 1.16.0 specreduce 1.3.0 photutils 1.12.0 astroquery 0.4.6 pyyaml 6.0.1 asteval 0.9.29 idna 3.4 traitlets 5.9.0 bqplot 0.12.43 bqplot-image-gl 1.4.11 glue-core 1.21.1 glue-jupyter 0.22.0 glue-astronomy 0.10.0 echo 0.8.0 ipyvue 1.9.0 ipyvuetify 1.8.4 ipysplitpanes 0.2.0 ipygoldenlayout 0.4.0 ipypopout 1.0.0 Jinja2 3.1.2 voila 0.4.0 vispy 0.12.1 sidecar 0.5.2