TypeError: __init__() got an unexpected keyword argument 'registry'

3.4k Views Asked by At

I'm doing some packages importations on google colab - I was working on these for a time, but then one day this message appeared to me when I tried to import photutils package, a package used by astronomers:


TypeError                                 Traceback (most recent call last)
<ipython-input-8-6005ccc011a4> in <module>
      1 try:
----> 2   import photutils
      3   import splusdata

26 frames
TypeError: __init__() got an unexpected keyword argument 'registry'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
/usr/local/lib/python3.8/dist-packages/astropy/nddata/mixins/ndio.py in __init__(self, instance, cls)
     53 
     54     def __init__(self, instance, cls):
---> 55         super().__init__(instance, cls, "read", registry=None)
     56         # uses default global registry
     57 

TypeError: __init__() got an unexpected keyword argument 'registry'

My importation code is:

try:
  import photutils
  import splusdata
  import astropy
  from astropy.wcs import WCS
  from astropy import units as u
  from astropy.stats import sigma_clipped_stats
  from astropy.coordinates import SkyCoord
  from astropy.table import Table, vstack, hstack
  from photutils.aperture import aperture_photometry, CircularAperture, CircularAnnulus, SkyCircularAperture, SkyCircularAnnulus
  from photutils.utils import calc_total_error
  import cmastro
except:
  !pip install photutils
  !pip install astropy
  !pip install splusdata
  !pip install cmastro

  import photutils
  import astropy
  from photutils.utils import calc_total_error
  from astropy.wcs import WCS
  from astropy.stats import sigma_clipped_stats
  from astropy import units as u
  from astropy.coordinates import SkyCoord
  from astropy.table import Table, vstack
  from photutils.aperture import aperture_photometry, CircularAperture, CircularAnnulus, SkyCircularAperture, SkyCircularAnnulus
  import cmastro

I tried to run my importation code onde day, and It wasn't working anymore.

0

There are 0 best solutions below