Giter VIP home page Giter VIP logo

Comments (11)

SimonSapin avatar SimonSapin commented on May 31, 2024

Hi,

Thanks for reporting this. I can’t reproduce this on Linux, and don’t have a Mac to test. What happens afterwards? Does Python crash? Do you get a traceback? Do you get a PDF file?

In any case, I just pushed a change to master to add a call to gobject.g_type_init(). Can you try the git version and see if it fixes the issue? This should work:

pip install git+git://github.com/Kozea/WeasyPrint.git

from weasyprint.

tdhulster avatar tdhulster commented on May 31, 2024

I tried the git version out and still get the same error ...
No crash, no traceback no pdf ...

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:99407): GLib-CRITICAL **: void g_once_init_leave(volatile void *, gsize): assertion `result != 0' failed

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:99407): GLib-CRITICAL **: void g_once_init_leave(volatile void *, gsize): assertion `result != 0' failed

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

(process:99407): GLib-GObject-CRITICAL **: gtype.c:2720: You forgot to call g_type_init()

from weasyprint.

migrome avatar migrome commented on May 31, 2024

Hello, Is it the same error or I just installed something wrong?
Windows 7. Python 2.7.
gtk2-runtime-2.24.10-2012-10-10-ash.exe
pygtk-all-in-one-2.24.0.win32-py2.7.msi
CFFI and lxml from http://www.lfd.uci.edu/~gohlke/pythonlibs/

just trying to "from weasyprint import HTML"

File "D:_IDE\eclipse\workspace\test\src\main.py", line 5, in
from weasyprint import HTML
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint_init_.py", line 304, in
from .css import PARSER, preprocess_stylesheet
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint\css_init_.py", line 30, in
from . import computed_values
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint\css\computed_values.py", line 20, in
from .. import text
File "D:_IDE\eclipse\workspace\test\src\lib\weasyprint\text.py", line 182, in
gobject.g_type_init()
File "C:\dev\Python27\lib\site-packages\cffi\api.py", line 385, in getattr
make_accessor(name)
File "C:\dev\Python27\lib\site-packages\cffi\api.py", line 381, in make_accessor
raise AttributeError(name)
AttributeError: g_type_init

from weasyprint.

SimonSapin avatar SimonSapin commented on May 31, 2024

My mistake. @migrome , can you try again with the change I just pushed to master? @tdhulster , if you did not have the same AttributeError @migrome , I suspect you might not be using the git version.

from weasyprint.

migrome avatar migrome commented on May 31, 2024

Works fine, thank you.

from weasyprint.

tdhulster avatar tdhulster commented on May 31, 2024

I did this :
pip install git+git://github.com/Kozea/WeasyPrint.git

But do I have to do something more to use it or should that work?

from weasyprint.

SimonSapin avatar SimonSapin commented on May 31, 2024

@tdhulster do you still have the error with the latest master now? Sometimes pip does nothing when it thinks everything is already installed. Does the output ends with something like "Installed WeasyPrint"? If not, try pip install --upgrade --no-deps (Just --upgrade would also reinstall all dependencies recursively.)

from weasyprint.

SimonSapin avatar SimonSapin commented on May 31, 2024

@tdhulster, I believe this bug is fixed now. Can you confirm? (Make sure you’re using the latest master, see previous message.)

from weasyprint.

SimonSapin avatar SimonSapin commented on May 31, 2024

Closing for lack of response plus belief that this is fixed.

from weasyprint.

barathik avatar barathik commented on May 31, 2024

I am getting the same error in mac. Was this resolved?

from weasyprint.

majidhosseini avatar majidhosseini commented on May 31, 2024

I am getting the same error on Arch Linux, and I used the last version (42.03).

from weasyprint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.