pkg_resources is available in python 3.12 only if setuptools is explicitely installed, which is not always the case. We fix that by replacing all usage of pkg_resources with importlib_resources and importlib_metadata. Close #966