Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'pyLDAvis.gensim' #25

Closed
AbhiPawar5 opened this issue Apr 26, 2021 · 5 comments · Fixed by #29
Closed

ModuleNotFoundError: No module named 'pyLDAvis.gensim' #25

AbhiPawar5 opened this issue Apr 26, 2021 · 5 comments · Fixed by #29
Labels
bug Something isn't working

Comments

@AbhiPawar5
Copy link

Hi Andrew,
I found this ModuleNotFoundError while running the line

from kwx.model import extract_kws

Error description:
25 import pandas as pd
26 import pyLDAvis
---> 27 import pyLDAvis.gensim
28 import seaborn as sns
29 from gensim import corpora

ModuleNotFoundError: No module named 'pyLDAvis.gensim'

But, it can be solved by installing :
pip install pyLDAvis==3.2.2

@andrewtavis andrewtavis added bug Something isn't working wontfix This will not be worked on labels Apr 26, 2021
@andrewtavis
Copy link
Owner

Hi Abhishek, and thanks for your interest and reporting this!

It looks like later versions of pyLDAvis changed the logic of how the gensim module was passed, and it's now gensim_models or gensimvis - see their history. The environment and requirement files for kwx have a valid 3.2.0 version as a dependency, so I'll leave this for now, but thank you for the documentation on this!

Let me know if there's something explicit you think should happen :)

@stale stale bot removed the wontfix This will not be worked on label Apr 26, 2021
@andrewtavis
Copy link
Owner

Or actually, sorry, I will take a look at this and see if there's a way to get this working on the most recent version of pyLDAvis. Will update you on the progress of this, and thanks for reporting :)

@andrewtavis andrewtavis reopened this Apr 26, 2021
@andrewtavis
Copy link
Owner

andrewtavis commented Apr 26, 2021

Literally was as easy as updating to the most recent version and switching import pyLDAvis.gensim to import pyLDAvis.gensim_models (included in a try statement) as well as its usage in the code :) I've also updated the requirements and environment files to allow for the most recent version :) All this is going through in #29.

Thanks again for these issues! Were very helpful 😊

@AbhiPawar5
Copy link
Author

AbhiPawar5 commented Apr 27, 2021

Thanks, Andrew!

EDIT : Maybe you also need to update the PyPi index/config, since this issue is still seen on fresh pip install for now.

@andrewtavis
Copy link
Owner

@AbhiPawar5, did you do a pip install update, as in:

pip install kwx -U

I did do an update of PyPI (FYI - capital I in PyPI, which is a common mistake 😊). If it's still happening with an update then I'll reopen this and give it another look :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants