I have problem when trying to run a website in Django:
OSError: no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': /lib/x86_64-linux-gnu/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var
cannot load library 'libcairo.so': /lib/x86_64-linux-gnu/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var
cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open shared object file: No such file or directory
cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open shared object file: No such file or directory
Althought the package is installed.
I have installed weasyprint
pip3 install weasyprint
python -m pip install WeasyPrint
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
I also tried
sudo apt install libcairo2-dev
sudo apt install libgirepository1.0-dev
I have Lubuntu system. Any ideas how can I fix it? Thanks in advance
undefined symbol: FT_Done_MM_Var
error may indicate some conflict withfreetype
package - is custom freetype-xxx installed? – Rearrangelibfreetype.so
somewhere, or you replaced your/usr/lib/x86_64-linux-gnu/libfreetype.so
with an older version and everything is broken. – Illuviationnm -DS /usr/lib/x86_64-linux-gnu/*freetype.so | grep FT_Done
can tell you if there is aFT_Done_MM_Var
function in there. (There are other functions that begin withFT_Done
- this is only there to ensure things work correctly, e.g. you should always seeFT_Done_Face
in the output.) – Illuviationpip list
). I also seeFT_Done_MM_Var
function after typingnm -DS /usr/lib/x86_64-linux-gnu/*freetype.so | grep FT_Done
. The error is still the same – Ambroid