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
Unable to create PDF with weasyprint 53.3 installed from conda on Windows #1472
Comments
Hello! If you use Conda, please don’t install GTK! Conda already has all the dependencies needed for WeasyPrint. Could you please tell us what you get when GTK is not installed? |
That's interesting, I did not know that. That appears to be a change from 52 to 53, correct (see below)?
I did not uninstall GTK but changed its directory name to "hide" it. Now I get a PDF. However, there is now a pango error which crashes the script:
If I revert to weasyprint 52.5 I get
which is what I'm used to when there is no GTK installation on the PATH. So it appears to me that 52.x requires a GTK installation while 53.x does not. I would suggest adding that information to the documentation's First Steps section. |
No, that didn’t change. If you install WeasyPrint using Conda’s package, all the needed libraries (pango, fontconfig…) are already installed as dependencies you don’t need to install GTK. If you install WeasyPrint using pip, you have to install the needed libraries by installing GTK.
Well, maybe there’s a bug in Conda’s Fontconfig package. Unfortunately, we don’t have a Windows computer to test :/. Maybe you could try to report a bug and see if people can reproduce.
Installing on Windows is a mess. We’ve tried many, many, many things to make this documentation better, but it’s never enough. As we don’t have any Windows computer at home, it’s definitely hard to test. What you can do is to try a fresh install, without Conda, following the documentation (and thus using GTK). |
Thanks for your help and information! I guess I will stick with 52.5 for a bit longer ;) I checked my conda installation and found the fontconfig files. They are from fontconfig 2.13.1 (consistent with the most current version at conda-forge). My local GTK3 installation (from here) has fontconfig 2.13.93, so much more recent. Maybe the pango bug was fixed in between versions. So the main issue is likely that the conda version of fontconfig should be updatd. |
We really have to fix #1435 and see if it fixes all the Windows problems that have been reported during the last months. |
Now that #1435 is fixed, this problem should be solved. Note that there’s currently an unrelated bug in Conda’s fontconfig: conda-forge/fontconfig-feedstock#49 |
The error with I tried to install a new virtual environment with Python 3.8 as well Python 3.9.7 and in both cases WeasyPrint failed to load.
Do you have a temporary alternative to this problem ? |
That’s a bug of Conda’s Fontconfig.
The easiest way now is to follow the official install steps instead of using Anaconda. Otherwise, you can ask Conda’s packagers how you can help them to fix Fontconfig’s package. |
Trying to follow the the official install steps doesn't really help. Here are the steps I followed and the error we get:
Attempting to import weasyprint results in an OSError:
|
This bug is #1435, you should use version 54.0 instead of 53.3. If you installed GTK in the default folder proposed by the installer, it will work out of the box. |
We get the same error both with v54.0 and v53.3 |
I got this error please help me solve this error |
@ajsmack Please try version 54 and see if it fixes your problem.
@UGuntupalli If you don’t use Anaconda at all (even for Python), install GTK in its default install folder, use WeasyPrint 54.0 with Python 3.8 or more recent, it should just work. 🤞 |
Problem description
This minimal example fails to produce a PDF file with weasyprint 53.3 and 53.2:
Note: The code runs fine and produces a PDF in weasyprint 52.5.
I also increased the log level of the weasyprint logger, this is the output:
Environment
Windows 10 Enterprise, 64 Bit
GTK 3 is the current gtk3-runtime-3.24.29-2021-04-29-ts-win64 from here.
I set up a fresh conda environment (Python 3.9.7) in Pycharm 2021.2.2 for this test and only installed weasyprint.
Output of
conda env export
:The text was updated successfully, but these errors were encountered: