dask / dask-ml

Scalable Machine Learning with Dask
http://ml.dask.org
BSD 3-Clause "New" or "Revised" License
893 stars 255 forks source link

Undeclared runtime dependency on setuptools #984

Closed flying-sheep closed 6 months ago

flying-sheep commented 6 months ago

When I try to use dask_ml, I get

>   from pkg_resources import DistributionNotFound, get_distribution
E   ModuleNotFoundError: No module named 'pkg_resources'

https://github.com/dask/dask-ml/blob/b3954e9ee1f7d7dee5ebdd5c4ca1b84f4dd96797/dask_ml/__init__.py#L1C6-L1C19

You need to either declare a runtime dependency on setuptools, or, much better, stop using the deprecated pkg_resources and use importlib.metadata from Python’s standard library instead: from importlib.metadata import version

flying-sheep commented 6 months ago

That solution is of course even better