Weasyprint Fontconfig error when importing into python

445 views Asked by At

When I import weasyprint I get the following error:

Fontconfig error: Cannot load default config file: No such file: (null)

Is there a way to suppress this error, because the program runs fine otherwise. Better yet, how do I correct it?

1

There are 1 answers

0
Javad On

If you're on a Unix-based OS, I Think You need to set the $FONTCONFIG_PATH properly in your OS. Usually it is set in /etc/profile but, if you are executing the command from a non login shell (e.g., through a python script or library), then you need to set it explicitly by doing the following command in your shell and And probably your problem will be solved:

➜ export FONTCONFIG_PATH=/etc/fonts