Skip to content

cannot import name 'imperials' from 'astropy.units' #11975

Description

@erwanp

Description

Our spectroscopy package radis depends on Astropy.units. Latest build fetched astropy==4.3
and failed with the following error :

AttributeError: module 'astropy.units' has no attribute 'imperial'

Expected behavior

Original code worked :

import astropy.units as u
u.K in (u.K, u.imperial.deg_F)
>>> cannot import name 'imperials' from 'astropy.units'

Now I have to update the code to

import astropy.units as u
from astropy.units.imperial import deg_F 
u.K in (u.K, deg_F)
>>> True

If this is the expected behavior (and cleaner way to import), this Issue can be closed right away. Hopefully the title will help people that would encounter the same proper to find an easy fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions