Traceback (most recent call last):
File "C:\Users\86183\Desktop\python\1.111.py", line 12, in
w.generate(txt)
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\wordcloud\wordcloud.py", line 632, in generate
return self.generate_from_text(text)
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\wordcloud\wordcloud.py", line 614, in generate_from_text
self.generate_from_frequencies(words)
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\wordcloud\wordcloud.py", line 446, in generate_from_frequencies
self.generate_from_frequencies(dict(frequencies[:2]),
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\wordcloud\wordcloud.py", line 496, in generate_from_frequencies
font = ImageFont.truetype(self.font_path, font_size)
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\PIL\ImageFont.py", line 878, in truetype
return freetype(font)
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\PIL\ImageFont.py", line 875, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\86183\AppData\Roaming\Python\Python310\site-packages\PIL\ImageFont.py", line 226, in init
self.font = core.getfont(
OSError: cannot open resource
有具体代码吗?谢谢