laklak
laklak

Reputation: 11

Cannot import name 'update_default_config' from 'astropy.config.configuration'

When I imported aplpy, I got this error: ImportError Traceback (most recent call last) Input In [12], in <cell line: 9>() 7 from astropy.coordinates import SkyCoord 8 import astropy.units as u ----> 9 import aplpy as ap 10 from glob import glob 11 import astropy.units as u

File ~/opt/anaconda3/lib/python3.9/site-packages/aplpy/__init__.py:9, in <module>
      2 """
      3 APLpy : Astronomical Plotting Library in Python
      4 """
      6 # Affiliated packages may add whatever they like to this file, but
      7 # should keep this content at the top.
      8 # ----------------------------------------------------------------------------
----> 9 from ._astropy_init import *  # noqa
     10 # ----------------------------------------------------------------------------
     12 if not _ASTROPY_SETUP_:  # noqa

File ~/opt/anaconda3/lib/python3.9/site-packages/aplpy/_astropy_init.py:21, in <module>
     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/zly/opt/anaconda3/lib/python3.9/site-packages/astropy/config/configuration.py)`enter code here`

Upvotes: 1

Views: 2229

Answers (2)

LucasJ
LucasJ

Reputation: 1

I had the same error, after reading the thread at https://github.com/aplpy/aplpy/issues/492#issuecomment-1922601132, I tried:

conda uninstall aplpy
conda uninstall astropy # might be already uninstalled by aplpy
conda install astropy==5.3.4
conda install aplpy

And it worked for me. Hope this helps!

Upvotes: 0

John Gordon
John Gordon

Reputation: 33335

Looks like astropy removed that function.

https://docs.astropy.org/en/stable/changelog.html#id1

Upvotes: 0

Related Questions