YouTube-Report
YouTube-Report copied to clipboard
wordcloud problems (python3.7)
Running the script only works with 3.7 for me and generates the following error after installing all dependencies for the correct version with "python3.7 -m pip install -r requirements.txt":
Generating Word Cloud.....
Traceback (most recent call last):
File "report.py", line 234, in <module>
visual.wordCloud()
File "report.py", line 83, in wordCloud
max_words=380,contour_width=2, prefer_horizontal=1).generate(unique_string)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 619, in generate
return self.generate_from_text(text)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 601, in generate_from_text
self.generate_from_frequencies(words)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 434, in generate_from_frequencies
max_font_size=self.height)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 483, in generate_from_frequencies
font = ImageFont.truetype(self.font_path, font_size)
File "/home/flew/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line 640, in truetype
return freetype(font)
File "/home/flew/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line 637, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/flew/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line 186, in __init__
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "report.py", line 234, in <module>
visual.wordCloud()
File "report.py", line 83, in wordCloud
max_words=380,contour_width=2, prefer_horizontal=1).generate(unique_string)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 619, in generate
return self.generate_from_text(text)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 601, in generate_from_text
self.generate_from_frequencies(words)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 434, in generate_from_frequencies
max_font_size=self.height)
File "/home/flew/.local/lib/python3.7/site-packages/wordcloud/wordcloud.py", line 483, in generate_from_frequencies
font = ImageFont.truetype(self.font_path, font_size)
File "/home/flew/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line 640, in truetype
return freetype(font)
File "/home/flew/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line 637, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/flew/.local/lib/python3.7/site-packages/PIL/ImageFont.py", line 186, in __init__
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
Enclose multi-line code blocks with 3 backticks to format it, like this: ``` multi line code ```
Looks more like a problem related to the differences between linux and windows, but I'll have to investigate further to confirm that assumption.
Traceback (most recent call last):
File "report.py", line 234, in
Original exception was:
Traceback (most recent call last):
File "report.py", line 234, in
Getting the same error, except without the 'apt_pkg' part. STDOUT and STDERR: https://paste.rs/MGB
Running on Arch Linux with Python 3.8.
Can you test if you get the same error when using my fork? Please open a separate issue there if there's still something wrong. Unlike other people, I'll actually fix the problem if there is one.
Can you test if you get the same error when using my fork? Please open a separate issue there if there's still something wrong. Unlike other people, I'll actually fix the problem if there is one.
Your issues are closed, but I tried it out anyway. The bug is still exactly the same.
I don't know why the issues were closed, they should be there now. I also hopefully fixed the OSError that gets raised in your case. Can you please confirm that?
The OSError is fixed, but I got a completely different error. See the fork for the issue.