pytroll / aggdraw

Python package wrapping AGG2 drawing functionality

Home Page:https://aggdraw.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to load font on Debian 9 with Python 3

opened this issue · comments

After using Aggdraw for a few days, I got the following error when trying to instantiate a Font object: IOError: cannot load font (no text renderer)

I have excluded a missing font or other obvious causes, and tried to rebuild the package using the FREETYPE_ROOT = "/usr/local" suggestion. But the error remained.

Strangely enough, the problem did not exist on my other computer. Thus I suspected that the error could be caused by a system depended problem. I eventually resorted to reinstalling my computer (which I actually needed to do anyway), but the problem remained.

After installing aggdraw as a super user (on Debian 9), the error seem to be gone... Meaning that there could be a problem in the package that results in it being unable to handle a local install of aggdraw (instead of global). It might help others if this problem is documented, and it might be solvable...?

Technically speaking: pip3 install aggdraw results in mentioned error, while sudo pip3 install aggdraw works fine.

FREETYPE_ROOT is no longer supported in aggdraw. We have replaced it with calls to the freetype-config command. What do you get in your terminal when you run freetype-config --prefix?

When you install aggdraw which of these two messages do you see === freetype found: or === freetype not available? If the former then there is something broken or unexpected with your setup. If the latter then you don't have freetype 2 installed.

@maxim1412 Do you have any updates or answers to my questions?

I didn't have any trouble with Freetype. I didn't give me any error except from the runtime error IOError: cannot load font (no text renderer). Which I solved as mentioned before. I just wanted to notify the maintainer that this behaviour occurs (during runtime).

@maxim1412 I'm sorry I haven't replied to this in so long, I thought I had. You did in fact have a problem with free type which is why you were getting that error. I asked you some questions early about what certain commands gave you as output which would help me debug this issue. Could you please provide me with more information so I can look in to it?

We test aggdraw on Ubuntu Linux and OSX with and without freetype installed and all of those environments pass our tests. This leads me to believe that there is something different about your environment that is causing issues during installation. You should not have to install aggdraw as root. That said, our ubuntu linux environments do use sudo to install freetype and other system-level dependencies.