本文介绍了没有名为pyLDAvis的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法导入pyLDAvis.

I can't import pyLDAvis.

它已安装,但由于某种原因,我无法导入它.

It is installed but for some reason, I can not import it.

我尝试过

conda update anaconda

pip install --upgrade pip

pip install --upgrade jupyter notebook

pip install pyLDAvis

安装pyLDAvis会返回消息已满足要求".因此,我尝试卸载并重新安装了该程序包,但仍然无法正常工作.其他任何软件包都从未发生过这种情况.

Installing pyLDAvis returns the message 'requirement already satisfied'. So I tried uninstalling and reinstalled the package but still doesn't work. This never happened with any other packages.

我该如何解决这个问题?

How can I solve this problem?

推荐答案

pyLDAvis gensim名称已更改.当我使用 gensim_models 而不是 gensim 时,交互式viz可以工作.

The pyLDAvis gensim name changed. When I use gensim_models rather than gensim the interactive viz works.

'gensim_models'名称是对 bmabey的回购.

The 'gensim_models' name is in the latest commit to bmabey's repo.

import pyLDAvis
import pyLDAvis.gensim_models as gensimvis
pyLDAvis.enable_notebook()

# feed the LDA model into the pyLDAvis instance
lda_viz = gensimvis.prepare(ldamodel, corpus, dictionary)

这篇关于没有名为pyLDAvis的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-12 20:20