WordCloud エラー
解決したいこと
WordCloudでエラーが発生しました。
解決方法を教えて下さい。
発生している問題・エラー
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-41-699767d88d7f> in <module>()
11 'こと', 'もう', 'いい', 'ある', 'ゆく', 'れる']
12
---> 13 wordcloud = WordCloud(font_path=fpath, width=600, height=400, background_color='white', stopwords=set(stop_words)).generate(text).to_image().show()
6 frames
/usr/local/lib/python3.6/dist-packages/PIL/ImageFont.py in __init__(self, font, size, index, encoding, layout_engine)
186 return
187 self.font = core.getfont(
--> 188 font, size, index, encoding, layout_engine=layout_engine
189 )
190 else:
OSError: cannot open resource
該当するソースコード
fpath = "System/Library/Fonts/AquaKana.ttc"
wordcloud = WordCloud(font_path=fpath, width=600, height=400, background_color='white', stopwords=set(stop_words)).generate(text)
自分で試したこと
fpathにて指定したフォントに問題があるのではないかと考え,いろいろ変更してみたのですが解決できませんでした。
お力を貸してくださると嬉しいです。よろしくお願いいたします。
0 likes