In order to start generating documents with Weasyprint I installed it on my Windows machine following these instructions:
https://weasyprint.readthedocs.io/en/stable/install.html#step-5-run-weasyprint
On my computer it works but I have a Django project where I want to integrate this library and I use pipenv.
How to install the necessary libraries even in the virtual environment?
I tried setting the path for the pycairo package into the Pipfile like
JavaScript
x
2
1
pycairo= {path= "C:/Program Files/GTK3-Runtime Win64/bin/"}
2
but still it throws the error:
JavaScript
1
2
1
OSError: dlopen() failed to load a library: cairo / cairo-2 / cairo-gobject-2 / cairo.so.2
2
I have 64bit Windows machine and this is the Pipfile:
JavaScript
1
25
25
1
[[source]]
2
name = "pypi"
3
url = "https://pypi.org/simple"
4
verify_ssl = true
5
6
[dev-packages]
7
pylint = "*"
8
9
[packages]
10
django = "*"
11
mysql = "*"
12
ipython = "*"
13
django-webpack = "*"
14
django-webpack-loader = "*"
15
django-livereload-server = "*"
16
pylint = "*"
17
reportlab = "*"
18
weasyprint = "*"
19
django-weasyprint = "*"
20
pycairo= {path= "C:/Program Files/GTK3-Runtime Win64/bin/"}
21
cairocffi = "*"
22
23
[requires]
24
python_version = "3.7"
25
Advertisement
Answer
You need install ‘GTK+ 64 Bit Installer’ path in this local:
C:msys2
Source: WeasyPrint Github