Skip to content
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

Help using Blabel #13

Open
coolyear123 opened this issue Sep 8, 2021 · 2 comments
Open

Help using Blabel #13

coolyear123 opened this issue Sep 8, 2021 · 2 comments

Comments

@coolyear123
Copy link

I've installed Blabel both with pip and by unzipping the source files but I still get an error in python when I try to do a test run. I don't know whats going on. Attached are the errors.

Traceback (most recent call last):
File "C:\Users\DPetit\PycharmProjects\snakeLabels\main.py", line 5, in
from blabel import LabelWriter
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\blabel_init_.py", line 5, in
from .blabel import LabelWriter
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\blabel\blabel.py", line 6, in
from weasyprint import HTML
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\weasyprint_init_.py", line 322, in
from .css import preprocess_stylesheet # noqa isort:skip
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\weasyprint\css_init_.py", line 27, in
from . import computed_values, counters, media_queries
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\weasyprint\css\computed_values.py", line 16, in
from ..text.ffi import ffi, pango, units_to_double
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\weasyprint\text\ffi.py", line 380, in
gobject = _dlopen(
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\weasyprint\text\ffi.py", line 377, in _dlopen
return ffi.dlopen(names[0]) # pragma: no cover
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\cffi\api.py", line 150, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\cffi\api.py", line 832, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\DPetit\PycharmProjects\AntScan\venv\lib\site-packages\cffi\api.py", line 827, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library 'gobject-2.0-0': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'gobject-2.0-0'

Process finished with exit code 1

@Zulko
Copy link
Member

Zulko commented Sep 8, 2021

Sorry to hear that. It looks like the failure happens during Weasyprint import. You should visit their Github, you may find a solution there (please report back if you do! looks like a Windows/Weasyprint issue).

@mightyroy
Copy link

mightyroy commented Feb 16, 2022

import os
# insert the GTK3 Runtime folder at the beginning
GTK_FOLDER = r'C:\Program Files\GTK3-Runtime Win64\bin'
os.environ['PATH'] = GTK_FOLDER + os.pathsep + os.environ.get('PATH', '')
from blabel import LabelWriter

Add the above before importing other libraries after installing GTK3 on windows. It worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants