Closed Gilthans closed 4 months ago
Hi!
You should not mix MSYS2 and Conda. Use only one of them, but not both.
If you use Conda, installing Conda’s WeasyPrint should just work. If it doesn’t, then it’s a problem with your Conda installation, and there’s not much we can do for you here (I’ve never used Conda myself).
If you use MSYS2 with the default install folder, it should work out of the box with Microsoft Store’s Python. If you install MSYS2 elsewhere, you can set the WEASYPRINT_DLL_DIRECTORIES
environment variable (looks like it’s what you did). If you use another version of Python, you may get other problems for reasons I don’t understand.
I've tried removing my venv folder and reinstalling from scratch, without setting the environment variable, but I still get the same issue...
I've tried removing my venv folder and reinstalling from scratch, without setting the environment variable, but I still get the same issue...
Let’s carefully follow the steps proposed by the documentation:
where python3
gives the correct path.pacman -S mingw-w64-x86_64-pango
and check that you have everything installed in C:\msys64\mingw64\bin
.python3 -m venv venv
in a basic shell (not Powershell), activate it with venv\Scripts\activate
.pip install weasyprint
.python3
and type import weasyprint
.If anything goes wrong during these steps, please share what went wrong, we’ll try to find a solution.
When everything works, you’ll be free to try a different way to install WeasyPrint (change MSYS2 path, install Python from elsewhere, use Conda…) We won’t be able to help you for this, but at least you’ll be able to go step by step and understand what’s exactly going on.
@Gilthans Did you find the time to try these steps?
Unfortunately in my case if I can't get it working in a conda environment this isn't relevant (it would require rewriting our deployment). I did try installing using pip inside the conda environment, but still did not work. Even after setting the environment variable, which appears to point to the right directory, it can't find the lib
Unfortunately in my case if I can't get it working in a conda environment this isn't relevant
If you want to use WeasyPrint with Conda, you don’t need MSYS2 at all. WeasyPrint is already packaged for Conda, with all its dependencies.
I've tried installing the conda package, but it still cannot find the dependency, even after recreating the environment from scratch
I've tried installing the conda package, but it still cannot find the dependency, even after recreating the environment from scratch
Hmm… The Conda packages seems to be downloaded regularly, I suppose that it works for some users. If it doesn’t work for you, maybe you’ll get more useful help by opening an issue on Conda’s bug tracker?
I've run into the same issue. When I install the pango conda-forge on Windows, there aren't any pangoft2 libraries included with it. I see pango-1.0-0, pangocairo-1.0-0, and pangowin32-1.0-0 dlls but no pangoft2 anything.
I've run into the same issue. When I install the pango conda-forge on Windows, there aren't any pangoft2 libraries included with it. I see pango-1.0-0, pangocairo-1.0-0, and pangowin32-1.0-0 dlls but no pangoft2 anything.
Looks like it’s a problem with Conda’s package. Let’s continue the discussion in https://github.com/conda-forge/weasyprint-feedstock/issues/31.
Hey there, I've installed weasyprint using conda in a separate environment. It seems to have installed all the dependencies (at least I can find them), but importing the library via python fails with:
Could not import weasyprint: cannot load library 'pangoft2-1.0-0': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'pangoft2-1.0-0'
After following the issues, I tried setting the environment variable, and verified it was set:
I get this:
E:\msys64\mingw64\bin
Which appears to be correct (at least, it contains a
libpangoft2-1.0-0.dll
file). However, the install still fails. What else should I be checking here?