1.官网下载python
这里选择下载稳定版本
![v2-02ed81f2a16de8b8f32150eb99e81ece_b.jpg](http://img-01.proxy.5ce.com/view/image?&type=2&guid=4cb8de88-ed2f-eb11-8da9-e4434bdf6706&url=https://pic3.zhimg.com/v2-02ed81f2a16de8b8f32150eb99e81ece_b.jpg)
右键以管理员身份运行
![v2-0d7f45e253f6f8b9dd8bf5a409cef226_b.jpg](http://img-02.proxy.5ce.com/view/image?&type=2&guid=4cb8de88-ed2f-eb11-8da9-e4434bdf6706&url=https://pic3.zhimg.com/v2-0d7f45e253f6f8b9dd8bf5a409cef226_b.jpg)
点击继续,直到出现如下界面
![v2-195fe4660324d8ddc4969f8267d74b69_b.jpg](http://img-03.proxy.5ce.com/view/image?&type=2&guid=4cb8de88-ed2f-eb11-8da9-e4434bdf6706&url=https://pic2.zhimg.com/v2-195fe4660324d8ddc4969f8267d74b69_b.jpg)
安装完成并打开使用
![v2-f8b4490ae6d4ac107ebcc8e57a808a02_b.jpg](http://img-02.proxy.5ce.com/view/image?&type=2&guid=4cb8de88-ed2f-eb11-8da9-e4434bdf6706&url=https://pic3.zhimg.com/v2-f8b4490ae6d4ac107ebcc8e57a808a02_b.jpg)
2.安装worldcloud包
![v2-9a8152adcd77de53263f19010a73e65e_b.jpg](http://img-02.proxy.5ce.com/view/image?&type=2&guid=4cb8de88-ed2f-eb11-8da9-e4434bdf6706&url=https://pic3.zhimg.com/v2-9a8152adcd77de53263f19010a73e65e_b.jpg)
然后就有俄罗斯套包等着你,一直不停的装
3.制作词云
然后就输入代码
>>> import jieba
>>> import wordcloud
>>> f = open("C:/Users/Lovely Girl/Desktop/工作/多伦湖.txt", "r", encoding="utf-8")
>>> t = f.read()
>>> f.close()
>>> ls = jieba.lcut(t)
>>> txt = " ".join(ls)
>>> w = wordcloud.WordCloud(
width = 700, height = 300,
background_color = "white",
font_path = "msyh.ttc",max_words = 20
)
>>> w.generate(txt)
>>> w.to_file("C:/Users/Lovely Girl/Desktop/工作/多伦湖.png")
最后生成图片
![v2-8db7eed2c515da61ef5b6f6a8487c856_b.jpg](http://img-02.proxy.5ce.com/view/image?&type=2&guid=4cb8de88-ed2f-eb11-8da9-e4434bdf6706&url=https://pic3.zhimg.com/v2-8db7eed2c515da61ef5b6f6a8487c856_b.jpg)