--- a/py/_vendored_packages/apipkg/__init__.py
+++ b/py/_vendored_packages/apipkg/__init__.py
@@ -27,15 +27,11 @@
 def distribution_version(name):
     """try to get the version of the named distribution,
     returs None on failure"""
-    from pkg_resources import get_distribution, DistributionNotFound
-
+    from importlib.metadata import PackageNotFoundError, version
     try:
-        dist = get_distribution(name)
-    except DistributionNotFound:
-        pass
-    else:
-        return dist.version
-
+        return version(name)
+    except PackageNotFoundError:
+        return None
 
 def initpkg(pkgname, exportdefs, attr=None, eager=False):
     """ initialize given package from the export definitions. """
