diff --git a/pytorch_wavelets/dtcwt/coeffs.py b/pytorch_wavelets/dtcwt/coeffs.py index 9339240..c8e5dd8 100644 --- a/pytorch_wavelets/dtcwt/coeffs.py +++ b/pytorch_wavelets/dtcwt/coeffs.py @@ -4,7 +4,16 @@ from __future__ import absolute_import from numpy import load -from pkg_resources import resource_stream + +try: + import importlib_resources + + def resource_stream(pkg_path, filename): + return importlib_resources.files(pkg_path).joinpath(filename).open("rb") + +except Exception: + from pkg_resources import resource_stream + try: import pywt _HAVE_PYWT = True diff --git a/requirements.txt b/requirements.txt index 74b3450..44e33fa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ numpy torch>=1.0.0 PyWavelets>=1.0.0 +importlib_resources >= 6.5 ; python_version >= "3.14"