Phoenix124 / scribd-downloader

318 stars 104 forks source link

Issue OSError: cannot load library 'gobject-2.0-0' #37

Closed mokarex closed 1 year ago

mokarex commented 3 years ago

Traceback (most recent call last): File "C:\Python39\Scripts\scribdl-script.py", line 33, in sys.exit(load_entry_point('scribd-downloader==1.3.1', 'console_scripts', 'scribdl')()) File "C:\Python39\Scripts\scribdl-script.py", line 25, in importlib_load_entry_point return next(matches).load() File "C:\Python39\lib\importlib\metadata.py", line 77, in load module = import_module(match.group('module')) File "C:\Python39\lib\importlib__init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 972, in _find_and_load_unlocked File "", line 228, in _call_with_frames_removed File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "C:\Python39\lib\site-packages\scribd_downloader-1.3.1-py3.9.egg\scribdl__init__.py", line 3, in File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "C:\Python39\lib\site-packages\scribd_downloader-1.3.1-py3.9.egg\scribdl\downloader.py", line 9, in File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 664, in _load_unlocked File "", line 627, in _load_backward_compatible File "", line 259, in load_module File "C:\Python39\lib\site-packages\scribd_downloader-1.3.1-py3.9.egg\scribdl\pdf_converter.py", line 1, in File "C:\Python39\lib\site-packages\md2pdf-0.5-py3.9.egg\md2pdf__init.py", line 8, in from md2pdf.core import md2pdf # noqa File "C:\Python39\lib\site-packages\md2pdf-0.5-py3.9.egg\md2pdf\core.py", line 5, in from weasyprint import HTML, CSS File "C:\Python39\lib\site-packages\weasyprint-53.3-py3.9.egg\weasyprint\init__.py", line 322, in from .css import preprocess_stylesheet # noqa isort:skip File "C:\Python39\lib\site-packages\weasyprint-53.3-py3.9.egg\weasyprint\css\init__.py", line 27, in from . import computed_values, counters, media_queries File "C:\Python39\lib\site-packages\weasyprint-53.3-py3.9.egg\weasyprint\css\computed_values.py", line 16, in from ..text.ffi import ffi, pango, units_to_double File "C:\Python39\lib\site-packages\weasyprint-53.3-py3.9.egg\weasyprint\text\ffi.py", line 380, in gobject = _dlopen( File "C:\Python39\lib\site-packages\weasyprint-53.3-py3.9.egg\weasyprint\text\ffi.py", line 377, in _dlopen return ffi.dlopen(names[0]) # pragma: no cover File "C:\Python39\lib\site-packages\cffi-1.15.0rc1-py3.9-win-amd64.egg\cffi\api.py", line 150, in dlopen lib, function_cache = _make_ffi_library(self, name, flags) File "C:\Python39\lib\site-packages\cffi-1.15.0rc1-py3.9-win-amd64.egg\cffi\api.py", line 832, in _make_ffi_library backendlib = _load_backend_lib(backend, libname, flags) File "C:\Python39\lib\site-packages\cffi-1.15.0rc1-py3.9-win-amd64.egg\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'

mokarex commented 3 years ago

could you help me to solve this issue

chimeforest commented 3 years ago

I also have run into this

chimeforest commented 3 years ago

Okay... I think I have a solution to this.

First, make sure you have GTK3 installed: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer/releases Then open up your path variables and move the GTK3 one all the way to the top.

What (apparently) is happening is that somewhere in another path variable you have another "libgobject-2.0-0.dll" for another program which is being found first. I found the hint here: https://github.com/Kozea/WeasyPrint/issues/971#issuecomment-664403521

It seems to work for me.

Phoenix124 commented 1 year ago

@mokarex it's problem of WeasyPrint, try latest python > 3.11