Closed Brithub closed 4 years ago
Lowercase "arial" threw an error, and MacOS doesn't have a startfile function Thanks for your contribution. but this gives an error on windows: "OSError: cannot open resource"
I experienced the issues @Brithub mentioned. I have tested with his branch and it works well. Thanks for the fix
Added a conditional to the font name, silly that it matters
Added a conditional to the font name, silly that it matters
it still returns error when generating word cloud
Generating Word Cloud.....
Traceback (most recent call last):
File "C:/Users/Yifeng/Desktop/Personal-YouTube-PDF-Report-Generator-master/report.py", line 244, in <module>
visual.wordCloud()
File "C:/Users/Yifeng/Desktop/Personal-YouTube-PDF-Report-Generator-master/report.py", line 88, in wordCloud
max_words=380,contour_width=2, prefer_horizontal=1).generate(unique_string)
File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 619, in generate
return self.generate_from_text(text)
File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 601, in generate_from_text
self.generate_from_frequencies(words)
File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 434, in generate_from_frequencies
max_font_size=self.height)
File "C:\Users\Yifeng\lib\site-packages\wordcloud\wordcloud.py", line 483, in generate_from_frequencies
font = ImageFont.truetype(self.font_path, font_size)
File "C:\Users\Yifeng\lib\site-packages\PIL\ImageFont.py", line 640, in truetype
return freetype(font)
File "C:\Users\Yifeng\lib\site-packages\PIL\ImageFont.py", line 637, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "C:\Users\Yifeng\lib\site-packages\PIL\ImageFont.py", line 186, in __init__
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
Same problem on linux
Apparently "arial" != "ariel"
Lowercase "arial" threw an error, and MacOS doesn't have a startfile function