Giter VIP home page Giter VIP logo

Comments (3)

dkmstr avatar dkmstr commented on May 18, 2024

Hi,
your problem seems to come from "cairo.parser", from here exactly:
[Wed Jan 13 02:43:44.965533 2021] [wsgi:error] [pid 163:tid 139882607359744] [remote 10.0.0.2:59877] File "/usr/local/lib/python3.6/site-packages/weasyprint/images.py", line 14, in
[Wed Jan 13 02:43:44.965538 2021] [wsgi:error] [pid 163:tid 139882607359744] [remote 10.0.0.2:59877] import cairosvg.parser
[Wed Jan 13 02:43:44.965545 2021] [wsgi:error] [pid 163:tid 139882607359744] [remote 10.0.0.2:59877] File "/usr/local/lib/python3.6/site-packages/cairosvg/init.py", line 99, in
[Wed Jan 13 02:43:44.965550 2021] [wsgi:error] [pid 163:tid 139882607359744] [remote 10.0.0.2:59877] svg2svg.doc = surface.Surface.convert.doc.replace(

Seems that something is missing on your cairo installation, and as soon as weasyprint tries to load it, it fails...

Hope this helps :).

Note: try an "import cairo.parser" from ipython for example, to try to get something more. Weasyprint tries to load it, but it cannot... May some library is missing in your platform?

from openuds.

osegarra avatar osegarra commented on May 18, 2024

Hi,

I have checked cairo and cairosvg and looks they are correctly installed.

[root@server1]# python3
Python 3.6.8 (default, Nov  5 2020, 18:03:20)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cairo
>>> import cairo.parser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cairo.parser'
>>> cairo.version
'1.16.3'
>>> import cairosvg
>>> import cairosvg.parser
>>> from cairosvg import svg2svg
>>> svg2svg.__doc__="hola"
>>>

>>>
[root@server1]# python3
Python 3.6.8 (default, Nov 5 2020, 18:03:20)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

from cairosvg import surface
from cairosvg import svg2svg
svg2svg.doc=surface.Surface.convert.doc.replace('the format for this class', 'SVG')
print(svg2svg.doc)
Convert an SVG document to SVG.

    Specify the input by passing one of these:

    :param bytestring: The SVG source as a byte-string.
    :param file_obj: A file-like object.
    :param url: A filename.

    Give some options:

    :param dpi: The ratio between 1 inch and 1 pixel.
    :param parent_width: The width of the parent container in pixels.
    :param parent_height: The height of the parent container in pixels.
    :param scale: The ouptut scaling factor.
    :param unsafe: A boolean allowing XML entities and very large files
                   (WARNING: vulnerable to XXE attacks and various DoS).

    Specifiy the output with:

    :param write_to: The filename of file-like object where to write the
                     output. If None or not provided, return a byte string.

    Only ``bytestring`` can be passed as a positional argument, other
    parameters are keyword-only.

The packages installed are slightly different thant the listed in the requirements document:

[root@server1]# pip3 list
Package                 Version
----------------------- ---------
asgiref                 3.3.1
bcrypt                  3.2.0
bitarray                1.6.1
cairocffi               1.2.0
CairoSVG                2.5.1
certifi                 2020.12.5
cffi                    1.14.4
chardet                 4.0.0
cryptography            2.9.2
cssselect2              0.4.1
cycler                  0.10.0
defusedxml              0.6.0
Django                  3.1.5
dnspython               2.1.0
gpg                     1.13.1
html5lib                1.1
idna                    2.10
kiwisolver              1.3.1
lxml                    4.6.2
matplotlib              3.3.3
mod-wsgi                4.6.4
mysqlclient             2.0.3
numpy                   1.19.5
ovirt-engine-sdk-python 4.4.9
paramiko                2.7.2
Pillow                  8.1.0
pip                     20.3.3
ply                     3.9
pyasn1                  0.3.7
pyasn1-modules          0.1.5
pycairo                 1.16.3
pycparser               2.14
pycrypto                2.6.1
pycurl                  7.43.0.2
PyNaCl                  1.4.0
pyOpenSSL               19.1.0
pyparsing               2.4.7
Pyphen                  0.10.0
python-dateutil         2.6.1
python-ldap             3.1.0
python-memcached        1.58
pytz                    2020.5
requests                2.25.1
rpm                     4.14.3
setuptools              39.2.0
six                     1.11.0
sqlparse                0.4.1
tinycss2                1.1.0
urllib3                 1.26.2
WeasyPrint              52.2
webencodings            0.5.1
xml-marshaller          1.0.2

Any help will be welcome.

Thansk a lot in advance
Ó

from openuds.

dkmstr avatar dkmstr commented on May 18, 2024

I'ts strange,
Some advices:
1.- We use python 3.7 for all our tests, not python 3.6 (i think there should be no problem with 3.6 anyway, just a comment)
2.- Have you tried to run "python3 manage.py runserver 0:8000" for example, to see if it starts without wsgi?
3.- Do not use "master". Master, as noticed on main page "readme", is always under heavy development, and it's not normally functional. Use the 3.0 branch instead.
4.- I have not tried apache on new 3.x branches, so my help is very limited, sorry :(,

from openuds.

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.