lmcinnes / umap

Uniform Manifold Approximation and Projection
BSD 3-Clause "New" or "Revised" License
7.39k stars 803 forks source link

No module named 'pkg_resources' #1065

Open erooke opened 11 months ago

erooke commented 11 months ago

I just recently installed umap. On attempting to import umap I got the following error:

 python umap_1.py
Traceback (most recent call last):
  File "/home/ethan/code/umap_1.py", line 2, in <module>
    import umap
  File "/home/ethan/code/.venv/lib/python3.11/site-packages/umap/__init__.py", line 36, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Installing setuptools into the venv fixed the issue. Should setuptools be declared as a dependency in setup.py?

baggiponte commented 9 months ago

Ciao! Not a maintainer here, but I'd like to ask you a couple of questions. What Python version are you using?

pkg_resources is deprecated and should be replaced with importlib.resources or, if not available, by installing the importlib-resources. I did a similar PR a while ago, should be fairly easy.

erooke commented 9 months ago

The version I ran into this issue on was 3.11.?

Unfortunately I no longer have the project I was working on around and a quick attempt to replicate the issue failed (that is to say umap installed and imported fine). I'm not sure if I'm going to be much help from here.