解决ERROR:‘No module named ‘pyLDAvis.gensim‘

您所在的位置:网站首页 pyldavis安装 解决ERROR:‘No module named ‘pyLDAvis.gensim‘

解决ERROR:‘No module named ‘pyLDAvis.gensim‘

2023-08-04 22:35| 来源: 网络整理| 查看: 265

在LDA可视化时,需要 import pyLDAvis.gensim as gensimvis,但是我出现了错误:‘ModuleNotFoundError: No module named 'pyLDAvis.gensim'

自己在百度几种方法后成功解决,写下来方便有缘人^.^

 

网上的解决方法是[报错原因是版本不同]:

原来的代码是:

import pyLDAvis.gensim

替换成

import pyLDAvis.gensim_models 

详见如下博客: 

解决报错“No module named ‘pyLDAvis.gensim‘”_居贝比的博客-CSDN博客 

我再尝试后仍旧不行,发现原因是没有pip install pyLDAvis

但是,在安装的时候又出现了ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。

针对拒绝访问,百度的方法大家可以尝试: 

即加上user

pip install +user+安装内容

成功解决Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问_一个处女座的程序猿-CSDN博客

我试了一下对我的问题,还是不适用滴

最终的解决方法很简单,将pip install 改为pip3 install

原来的安装是

pip install pyLDAvis

 改为:

pip3 install pyLDAvis

方法详见Python出现Could not find a version that satisfies the requirement openpyxl (from versions: )_木岩My-CSDN博客

成功安装!



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3