I followed the instructions from http://weasyprint.readthedocs.io/en/latest/install.html#windows
test & error message
>python -m weasyprint http://weasyprint.org weasyprint.pdf
Traceback (most recent call last):
File "c:\python34\Lib\runpy.py", line 151, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name)
File "c:\python34\Lib\runpy.py", line 118, in _get_module_details
return _get_module_details(pkg_main_name)
File "c:\python34\Lib\runpy.py", line 104, in _get_module_details
spec = importlib.util.find_spec(mod_name)
File "C:\Users\user\Envs\ch_dev\lib\importlib\util.py", line 86, in find_spec
parent = __import__(parent_name, fromlist=['__path__'])
File "C:\Users\user\Envs\ch_dev\lib\site-packages\weasyprint\__init__.py", line 338, in <module>
from .css import PARSER, preprocess_stylesheet # noqa
File "C:\Users\user\Envs\ch_dev\lib\site-packages\weasyprint\css\__init__.py", line 30, in <module>
from . import computed_values
File "C:\Users\user\Envs\ch_dev\lib\site-packages\weasyprint\css\computed_values.py", line 18, in <module>
from .. import text
File "C:\Users\user\Envs\ch_dev\lib\site-packages\weasyprint\text.py", line 216, in <module>
'libgobject-2.0.dylib')
File "C:\Users\user\Envs\ch_dev\lib\site-packages\weasyprint\text.py", line 212, in dlopen
return ffi.dlopen(names[0]) # pragma: no cover
File "C:\Users\user\Envs\ch_dev\lib\site-packages\cffi\api.py", line 139, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\user\Envs\ch_dev\lib\site-packages\cffi\api.py", line 769, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\user\Envs\ch_dev\lib\site-packages\cffi\api.py", line 758, in _load_backend_lib
return backend.load_library(name, flags)
OSError: cannot load library gobject-2.0: error 0x7e
pip freeze
>pip freeze
cairocffi==0.7.2
CairoSVG==1.0.22
cffi==1.8.3
cssselect==1.0.0
Django==1.10.2
django-appconf==1.0.2
django-ckeditor==5.1.1
django-compressor==2.1
django-debug-toolbar==1.6
django-grappelli==2.8.2
django-taggit==0.21.3
django-taggit-autosuggest==0.3.0
html5lib==0.999999999
lxml==3.6.4
mysqlclient==1.3.8
Pillow==3.4.2
pycparser==2.16
Pyphen==0.9.4
rcssmin==1.0.6
rjsmin==1.0.12
six==1.10.0
sqlparse==0.2.1
tinycss==0.3
WeasyPrint==0.31
webencodings==0.5
search in Python libraries
Searching 6610 files for "gobject-2.0" (regex)
C:\Users\user\Envs\ch_dev\Lib\site-packages\cairocffi\pixbuf.py:
30
31 gdk_pixbuf = dlopen(ffi, 'gdk_pixbuf-2.0', 'gdk_pixbuf-2.0-0')
32: gobject = dlopen(ffi, 'gobject-2.0', 'gobject-2.0-0')
33 glib = dlopen(ffi, 'glib-2.0', 'glib-2.0-0')
34 try:
C:\Users\user\Envs\ch_dev\Lib\site-packages\weasyprint\text.py:
213
214
215: gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so',
216: 'libgobject-2.0.dylib')
217 pango = dlopen(ffi, 'pango-1.0', 'libpango-1.0-0', 'libpango-1.0.so',
218 'libpango-1.0.dylib')
6 matches across 2 files
part of PATH
> print(os.environ.get('PATH')) # contains
...; C:\Program Files (x86)\Graphviz2.38\bin;C:\Program Files (x86)\Graphviz2.38\lib; ... ;C:\Program Files\GTK3-Runtime Win64\lib;
DLL present
I have C:\Program Files\GTK3-Runtime Win64\lib\libgobject-2.0-0.dll
quickfix
after playing with dlopen() functions I got a message informing of a problem with DLL in Graphviz, so I changed the order of PATH instructions placing GTK before Graphviz. After that the test almost worket producing the following error
>python -m weasyprint http://weasyprint.org weasyprint.pdf
Failed to load stylesheet at https://fonts.googleapis.com/css?family=Oswald : URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
Failed to load stylesheet at https://fonts.googleapis.com/css?family=Alegreya+Sans:400,400italic,700 : URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
Failed to load stylesheet at https://fonts.googleapis.com/css?family=Cousine : URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)>
Ignored `transition: color 0.25s` at 14:18, unknown property.
Ignored `text-shadow: 1px 1px 1px #111` at 18:125, unknown property.
(python.exe:7236): Pango-WARNING **: couldn't load font "Cousine Not-Rotated 12.9599609375px", falling back to "Sans Not-Rotated 12.9599609375px", expect ugly output.
I followed the instructions from http://weasyprint.readthedocs.io/en/latest/install.html#windows
test & error message
pip freeze
search in Python libraries
part of PATH
DLL present
I have C:\Program Files\GTK3-Runtime Win64\lib\libgobject-2.0-0.dll
quickfix
after playing with dlopen() functions I got a message informing of a problem with DLL in Graphviz, so I changed the order of PATH instructions placing GTK before Graphviz. After that the test almost worket producing the following error