Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weasyprint Fontconfig error when importing into python

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?

like image 366
prime90 Avatar asked Oct 24 '25 02:10

prime90


1 Answers

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
like image 151
Javad Nikbakht Avatar answered Oct 26 '25 16:10

Javad Nikbakht



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!