Closed krambono closed 3 years ago
I am on mac and I am getting OSError: cannot open resource
when trying to run flowkey-dl
. It seems to have to do with the fonts fnt = [ImageFont.truetype('FreeMono.ttf', sz) for sz in font_size]
. Do you know how to fix this? I didn't run apt install python-tk python3-tk
because I believe Tkinter should already be installed with python on mac.
As far as I know, tkinter should be included in python by default. However, I added the note as you suggested. Did the installation using pip fail?
The font issue is separate, but I added additional workarounds: if freemono is not found, I now try to load arial, and if that is not there the default is loaded - which is fixed size but better than crashing the app. The fix would be to install the corresponding font on your system, such that ImageFont finds it. See https://pillow.readthedocs.io/en/stable/reference/ImageFont.html
Your fix worked, thanks @MatthiasLienhard!
@MatthiasLienhard Actually when trying to save a sheet I get this error:
saving raw image of sheet - to /Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/raw/5SbNyQhdXTR8gGkLJ.png
Exception in Tkinter callback
Traceback (most recent call last):
File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/tkinter/__init__.py", line 1883, in __call__
return self.func(*args)
File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/flowkey_dl_gui.py", line 127, in save
save_png(self.image, self.url.get(), self.artist.get(), self.title.get())
File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/flowkey_dl.py", line 164, in save_png
Image.fromarray(image).save(filename, pnginfo=metadata)
File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/PIL/Image.py", line 2155, in save
fp = builtins.open(filename, "w+b")
FileNotFoundError: [Errno 2] No such file or directory: '/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/raw/5SbNyQhdXTR8gGkLJ.png'
Seems like it is related to the Tkinter changes you might've made?
@MatthiasLienhard Actually when trying to save a sheet I get this error:
saving raw image of sheet - to /Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/raw/5SbNyQhdXTR8gGkLJ.png Exception in Tkinter callback Traceback (most recent call last): File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/tkinter/__init__.py", line 1883, in __call__ return self.func(*args) File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/flowkey_dl_gui.py", line 127, in save save_png(self.image, self.url.get(), self.artist.get(), self.title.get()) File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/flowkey_dl.py", line 164, in save_png Image.fromarray(image).save(filename, pnginfo=metadata) File "/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/PIL/Image.py", line 2155, in save fp = builtins.open(filename, "w+b") FileNotFoundError: [Errno 2] No such file or directory: '/Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/raw/5SbNyQhdXTR8gGkLJ.png'
Seems like it is related to the Tkinter changes you might've made?
You have to create the "raw" directory. /Users/SGGS1234/opt/anaconda3/lib/python3.8/site-packages/flowkey_dl/raw/
@MatthiasLienhard I was talking about this in my other issue.
I assume all for all separate issues there is at least a workaround
Hello,
First of all, I would like to thank you for that program ! It seems good.
For the installation, I had a few problems. I think you should add this to your README :
apt install python-tk python3-tk