dlopen() failed to load a library: cairo / cairo-2

后端 未结 6 1096
走了就别回头了
走了就别回头了 2020-12-18 18:43

This is my view:

from django.conf import settings
from django.http import HttpResponse
from django.template.loader import render_to_string
import weasyprint
         


        
6条回答
  •  被撕碎了的回忆
    2020-12-18 19:24

    If you are getting this error when using weasyprint, then you may have forgotten to install Pango, GdkPixbuf, and cairo dependencies of weasyprint which cannot be installed using pip/pip3

    For Debain/Ubuntu

    sudo apt-get install build-essential python3-dev python3-pip python3-setuptools python3-wheel python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
    

    For other platforms refer the below link

    https://weasyprint.readthedocs.io/en/latest/install.html

提交回复
热议问题