【问题标题】:WordCloud: the wordcloud.generate(text) function cannot runWordCloud:wordcloud.generate(text) 函数无法运行
【发布时间】:2021-03-16 06:11:07
【问题描述】:

当我尝试使用wordcloud.generate(text) 函数时,我发现无法运行并显示一个包含有关Python 信息的窗口已停止工作。首先,我认为是版本问题(我的WordCloud版本是3.3.3,win7下python版本是3.8.3),所以我尝试使用wheel install WordCloud,版本是wordcloud-1.8.1-cp38-cp38- win32.whl。这是我的代码:

from wordcloud import WordCloud
import matplotlib.pyplot as plt

text = "dog dog cat cat dog"
wordcloud=WordCloud()
wordcloud.generate(text)

但是当我尝试删除wordcloud.generate(text)时,它可以运行

【问题讨论】:

    标签: python word-cloud


    【解决方案1】:

    当我卸载我的旧 python 并安装一个新版本是 3.7.9_win_amd64,然后我尝试
    重启使用pip install wordcloud,我发现可以运行良好。我想那一定是老版本的python和我的系统冲突了。版本是win_amd64和旧版python 是 32 位的。

    【讨论】:

      猜你喜欢
      • 2023-04-09
      • 2020-11-10
      • 1970-01-01
      • 1970-01-01
      • 2021-06-06
      • 2019-03-10
      • 2018-07-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多