TypeError in importing BERTopic from bertopic

I had a TypeError when I tried to import BERTopic after installing bertopic.

!pip install bertopic
from bertopic import BERTopic 
TypeError: __init__() got an unexpected keyword argument 'cachedir'

I searched for answers in other forums like stackoverflow but none of them seem related to the bertopic library, and thus were not really useful. Does anyone know how I can solve this issue?

That is a result of a new release of joblib which is not yet supported by the most recent HDBSCAN. You can, however, either use an older version of joblib (pip install --upgrade joblib==1.1.0) or install HDBSCAN from its main branch which does include a fix for this. You can find more about this on this issue page of HDBSCAN.