The WordCloud workbench

micropip, then plt.imshow.

First from wordcloud import WordCloud may take a minute (micropip). Then plt.imshow and plt.show().

Goal

Run every block and confirm the chart is visible.

from wordcloud import WordCloud
text = "Nairobi kiosk mango soda airtime bread Nairobi Mombasa Kisumu Nakuru Eldoret kiosk kiosk mango rainfall shillings units Nairobi stall coastal lakeside highland"
wc = WordCloud(width=400, height=220, background_color="white").generate(text)
plt.imshow(wc, interpolation="bilinear")
plt.axis("off")
plt.show()
print("cloud")
from wordcloud import WordCloud
wc = WordCloud(width=300, height=180, background_color="white").generate("Nairobi Mombasa Kisumu Nairobi")
plt.imshow(wc, interpolation="bilinear")
plt.axis("off")
plt.show()
print("small")
Pitfall

Always plt.axis('off') and plt.show().