scikit-learn-contrib / hdbscan

A high performance implementation of HDBSCAN clustering.
http://hdbscan.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
2.81k stars 507 forks source link

Initialisation fails with joblib 1.2.0 #562

Open phgn0 opened 2 years ago

phgn0 commented 2 years ago

With the latest joblib dependency version released today, HDBSCAN fails to initialize using the default parameters:

__init__() got an unexpected keyword argument 'cachedir':
File "/usr/local/lib/python3.9/site-packages/hdbscan/hdbscan_.py", line 509, in <module>
File "/usr/local/lib/python3.9/site-packages/hdbscan/__init__.py", line 1, in <module>

It seems like the Memory() cachedir parameter was renamed to location, according to https://joblib.readthedocs.io/en/latest/generated/joblib.Memory.html. I'm not sure if there are other changes.

For now this can be resolved by pinning joblib==1.1.0.

kupuguy commented 2 years ago

The commit comment to that change in joblib says "removed deprecated cachedir" so it seems to have been a deliberate cleanup.

lmcinnes commented 2 years ago

So it looks like we can just use a positional argument and support both versions. I'll see if I can get this done soon.

moi90 commented 2 years ago

I'm looking forward to the release containing this fix!

datlife commented 2 years ago

As a temporary remedy, one can force to install older joblib in order to avoid this issue:

# after installing hdbscan

pip --force-reinstall install joblib=1.1.0
johnlees commented 2 years ago

Thanks for fixing this! Can I also add my voice to request a release as soon as possible, as this is breaking various CI and conda recipes which depend on HDBSCAN and are automatically pulling in the newer joblib

uros-r commented 2 years ago

Given this new CVE, affecting joblib versions < 1.2.0, it would be great to get a new release out.

sgbaird commented 2 years ago

Wasn't sure what CVE was until I saw a pip vulnerability and came back to this thread, so for others, be aware that there is a vulnerability. Thanks for bringing to attention @uros-r