这是我在python中关于情绪分析的代码,所以我在jupyter lab上遇到了一个问题,错误是没有模块名,但我有关于安装部分pip install VADERTOMITION和环境变量的所有信息。那我该怎么办
from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
analyser = SentimentIntensityAnalyzer()
def sentiment_analyzer_scores(sentence):
score = analyser.polarity_scores(sentence)
print("{:-<40} {}".format(sentence, str(score)))
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-22-f1fda500aee5> in <module>
----> 1 from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer
2 analyser = SentimentIntensityAnalyzer()
3
4 def sentiment_analyzer_scores(sentence):
5 score = analyser.polarity_scores(sentence)
ModuleNotFoundError: No module named 'vaderSentiment'
尝试安装它的full master branch zip file并将其解压缩到主文件位置,然后尝试以与之前相同的方式导入,或者尝试使用另一行代码导入它
还要检查是否只安装了一个python版本,而没有安装多个
请尝试将pip、python和VaderMotion升级到最新版本
相关问题 更多 >
编程相关推荐