With WeasyPrint, I need to do the following in order to get the required libraries:
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 have added this to my GitHub triggers as it builds:
- name: Install WeasyPrint dependencies
run: |
cd /home
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
And when I view the build logs, it shows that it is successful; however, the Python app will still not start, saying it could not find the required libraries:
OSError: no library called "cairo" was found
no library called "libcairo-2" was found
cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared
No such file or directory
cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open
No such file or directory
cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open
No such file or directory
I tried to do what another user did (successfully, it seems) and just log in via SSH to install it directly, but when I try to do this, apt-get throws 404 errors, for example:
(antenv) root@13f25a3adfa1:/tmp/8d947bb726491c3# apt-get install libcairo2
Reading package lists... Done
Building dependency tree
[. . .]
Fetched 4156 kB in 0s (4207 kB/s)
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/libx/libx11/libx11-data_1.6.4-3+deb9u3_all.deb 404 Not Found
E: Failed to fetch http://security.debian.org/debian-security/pool/updates/main/libx/libx11/libx11-6_1.6.4-3+deb9u3_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Does Azure App Service not allow you to do this anymore? I'm at a loss as to what to try next.
EDIT: So I was able to get all of the dependencies to add by SSHing into the machine and running apt-get update first. However, I still run into the issue of my Python app still not being able to run. I see the following errors, even though the libraries installed:
2021-07-19T14:43:06.741297128Z OSError: no library called "cairo" was found
2021-07-19T14:43:06.741300828Z no library called "libcairo-2" was found
2021-07-19T14:43:06.741304429Z cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory
2021-07-19T14:43:06.741308229Z cannot load library 'libcairo.2.dylib': libcairo.2.dylib: cannot open shared object file: No such file or directory
2021-07-19T14:43:06.741311929Z cannot load library 'libcairo-2.dll': libcairo-2.dll: cannot open shared object file: No such file or directory