Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'FreeTypeFont' object has no attribute 'getsize_multiline' #2

Closed
AerlenTheStout opened this issue Sep 2, 2021 · 4 comments

Comments

@AerlenTheStout
Copy link

AerlenTheStout commented Sep 2, 2021

So I think the problem here is something with pillow or the font, when I try to install/update/upgrade pillow with python3 it gives me a build error for/Pillow-8.3.2 and when I install with python it installs Pillow-6.2.2 what is the proper version? Also, should I be using python3 or python?
Installing pillow with python
image
Installing pillow with python3
image
running with python3
image
also, when I run main.py with python it gives me an error about async def
image

also, when I try to use your command in the readme to install discord api it gives me an error but works when I use python3 -m pip install -U discord.py it works

installing discord with python
image
installing discord with python3
image

@AerlenTheStout
Copy link
Author

Sorry if this is a lot, I'm happy to help wherever I can

@AerlenTheStout
Copy link
Author

AerlenTheStout commented Sep 2, 2021

After looking more in depth (on Reddit) I think that attribute getsize_multiline is only in pillow for python 2.7, and I'm getting errors when trying to install pillow from python get that as said above
reddit thread: https://www.reddit.com/r/learnpython/comments/343afg/when_i_try_to_call_pilimagefontimagefontgetsize_i/

@nobrien97
Copy link
Owner

Yeah, so in many Linux distros python by default runs python 2, which is quite a different language to python 3. I forgot that I had set python as an alias of python3 in my .bashrc, hence why it isn't working for you. I've updated the readme to be more clear. I just updated Pillow and it still works fine. You'll need to use python3. From the error, for some reason you're missing a dependency.... try installing libjpeg and/or libjpeg-dev
See here: python-pillow/Pillow#5042

@AerlenTheStout
Copy link
Author

It worked flawlessly
Thank you so much bro this is the first thing I have done with discord botting and also probably the coolest thing I have ever done with code thank you so much for helping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants