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
Importing scipy.stats does not work in TECA_superbuild. It appears that pytorch installs the dataclasses module, but it's no longer necessary as of python 3.7. Running pip3 uninstall dataclasses fixes the issue. We might want to add this at the end of the superbuild.
Note that I ran the pip uninstall command above on the NERSC install of superbuild (/global/common/software/m1517/teca/master-814afb06/), so I think this won't be reproducible at NERSC (sorry about that @burlen).
To reproduce:
python3 -c 'import scipy.stats'
raceback (most recent call last):
File "/global/project/projectdirs/m1517/cascade/taobrien/c20c_ars/ar_precip_check/./teca_get_correlations.py", line 8, in <module>
import scipy.stats
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/scipy/stats/__init__.py", line 441, in <module>
from .stats import *
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/scipy/stats/stats.py", line 37, in <module>
from scipy.spatial.distance import cdist
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/scipy/spatial/__init__.py", line 102, in <module>
from ._geometric_slerp import geometric_slerp
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/scipy/spatial/_geometric_slerp.py", line 8, in <module>
from scipy.spatial.distance import euclidean
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/scipy/spatial/distance.py", line 1650, in <module>
class CDistMetricWrapper:
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/dataclasses.py", line 950, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/dataclasses.py", line 800, in _process_class
cls_fields = [_get_field(cls, name, type)
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/dataclasses.py", line 800, in <listcomp>
cls_fields = [_get_field(cls, name, type)
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/dataclasses.py", line 659, in _get_field
if (_is_classvar(a_type, typing)
File "/global/common/software/m1517/teca/develop-8e6c7571/lib/python3.8/site-packages/dataclasses.py", line 550, in _is_classvar
return type(a_type) is typing._ClassVar
AttributeError: module 'typing' has no attribute '_ClassVar'
Importing
scipy.stats
does not work in TECA_superbuild. It appears that pytorch installs thedataclasses
module, but it's no longer necessary as of python 3.7. Runningpip3 uninstall dataclasses
fixes the issue. We might want to add this at the end of the superbuild.Note that I ran the pip uninstall command above on the NERSC install of superbuild (
/global/common/software/m1517/teca/master-814afb06/
), so I think this won't be reproducible at NERSC (sorry about that @burlen).To reproduce:
python3 -c 'import scipy.stats'
See ray-project/tune-sklearn#181 and huggingface/transformers#8638
The text was updated successfully, but these errors were encountered: