You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Last night everything just worked perfectly fine, this morning i unable to import metpy.
Operating System
Other
Version
1.6.3
Python Version
3.10.12 (google colab)
Code to Reproduce
import metpy.calc as mpcalc
Errors, Traceback, and Logs
usr/local/lib/python3.10/dist-packages/xarray/backends/plugins.py:110: RuntimeWarning: Engine 'gini' loading failed:
cannot inherit frozen dataclass from a non-frozen one
external_backend_entrypoints = backends_dict_from_pkg(entrypoints_unique)
TypeError Traceback (most recent call last)
in <cell line: 11>()
9 obs= xr.open_mfdataset('/content/drive/MyDrive/thesis/DATA/ERA5/ERA_2016*.nc', decode_times=False) #.sel(valid_time=time).compute()
10
---> 11 import metpy.calc as mpcalc
12 #from metpy.units import units
13 #from metpy.constants import Lv, Rd, Rv, Cp_v, Cp_d, g
9 frames
/usr/lib/python3.10/dataclasses.py in _process_class(cls, init, repr, eq, order, unsafe_hash, frozen, match_args, kw_only, slots)
988 # Raise an exception if we're frozen, but none of our bases are.
989 if not any_frozen_base and frozen:
--> 990 raise TypeError('cannot inherit frozen dataclass from a '
991 'non-frozen one')
992
TypeError: cannot inherit frozen dataclass from a non-frozen one
I had the same problem. It is causes by flexparser (imported via pint) releasing version 0.4 which will be used by default.
Temporary workaround is to install flexparser at version 0.3.1
Activity
kibidev commentedon Nov 7, 2024
I had the same problem. It is causes by flexparser (imported via pint) releasing version 0.4 which will be used by default.
Temporary workaround is to install flexparser at version 0.3.1
dopplershift commentedon Nov 7, 2024
Yes, either roll back to flexparser 0.3.1 or update to the (now available) pint 0.24.4.
Closing since there's nothing for MetPy to do here.