-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
Cannot load fontconfig in pyinstaller standalone #1898
Comments
Hi!
It means that the version of FontConfig you’re using is not configured to find any fonts. I don’t know how you did install FontConfig, but it’s configured correctly with the GTK3 installer proposed by the official documentation.
It means that your version of Pango is not 1.44+ as asked by the documentation. The |
Thanks you so much for the quick response,. I guess i need to know how to implement the newer version of Pango to pyinstaller but i'm on the wrong repo for this haha But also i installed the gtk3 on windows, but i think as i said to give it directly to pyinstaller Edit: |
Hi, i'm back. I've been trying to feed the fonts.conf from linux with modified path, but it feels like it does nothing. What kind of file is expected, where is he looking for ? (i tried to backtrace in the code but you get back to pango dll) |
Hi! In the GTK3 installer, Fontconfig’s config files are stored here: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/tree/master/gtk-nsis-pack/etc/fonts |
Thanks for the info but apparently weasyprint isn't satisfied yet. Or maybe he can't find the fonts.conf .... |
if Fontconfig can’t find the configuration, then there’s probably nothing we can do for you there :/, it’s not directly related to WeasyPrint as it works when it’s not used with pyinstaller. Maybe pyinstaller’s maintainers can help you on this topic? |
Yeah i have an issue opened there too. I'll update it. And if i have the answer post it here too. |
Good idea. Could you please write the link of the issue here so that we can follow? |
Hey, sorry i forgot to send the link but here is the fix: So to make weasyprint work in pynstaller without modifying the file and all i just took an older version of GTK3 and weasyprint. As adviced in this stack. |
Thanks for the link. That’s strange, because WeasyPrint works correctly on Windows without pyinstaller, with the latest versions of the different libraries. If using older versions works for you, there’s probably no need to find exactly where the problem comes from. If anyone has this problem and wants to find a solution, don’t hesitate to add a comment, we’ll reopen the issue. |
Hi,
So whenever i compile my standalone with pyinstaller i get this message:
C:\Users\Cyril_Gainon\PycharmProjects\manufacturing-testing-tool\venv\lib\site-packages\weasyprint\text\fonts.py:62: UserWarning: FontConfig cannot load default config file. Expect ugly output.
warn('FontConfig cannot load default config file. Expect ugly output.')
At first i had only rectangle displayed on my pdf, but i upgrader to the last weasyprint 59.0 and i still have this error when creating my standalone with pyinstaller but now on my application i have this error:
AttributeError: function/symbol 'pango_context_set_round_glyph_positions' not found in library 'C:\Users<name>\AppData\Local\Temp_MEI83642\pango-1.0-0.dll': error 0x7f
Here is all the package i installed so far:
streamlit == 1.22.0
pythonping == 1.1.4
weasyprint==59.0
opencv-python == 4.5.1.48
blur-detector == 0.0.6
streamlit-ext == 0.1.7
deepdiff == 6.3.0
paramiko == 3.1.0
beautifulsoup4 == 4.12.2
lxml == 4.9.2
pandas == 2.0.1
numpy == 1.21.1
requests == 2.28.2
pydub == 0.25.1
scipy == 1.9.1
xlrd == 2.0.1
flirimageextractor == 1.5.1
matplotlib == 3.5.3
loguru == 0.7.0
pytest == 7.3.1
pyinstaller == 5.10.1
pydyf==0.6.0
cffi==1.15.1
html5lib==1.1
fonttools==4.39.4
tinycss2==1.2.1
cssselect2==0.7.0
pyphen==0.14.0
pillow==9.5.0
ffmpeg==1.4
The text was updated successfully, but these errors were encountered: