bmabey/pyLDAvis

ModuleNotFoundError: No module named 'pyLDAvis.sklearn'

AsmaZbt opened this issue · 4 comments

hello,

I have installed pyLDAvis with pip as mentioned in the documentation.
I successfully imported
import pyLDAvis
import pyLDAvis.gensim

however when I would like to importe the pyLDAvis.sklearn I got this error:

ModuleNotFoundError: No module named 'pyLDAvis.sklearn'

pyLDAvis.version
'3.4.0'

can you help me please?

pip install pyldavis==3.2.2

per #245

pyLDAvis v 3.4.0 no longer has the file sklearn.py in the pip package.

Replace any logic involving

import pyLDAvis.sklearn
...
pyLDAvis.sklearn.prepare

with

import pyLDAvis.lda_model
...
pyLDAvis.lda_model.prepare

Thanks a lot! I tried lda_model and succeeded