Closed vlntsolo closed 1 year ago
Hello!
If /usr/lib64/libcairo.so.2
exists, then Python should be able to find it with dlopen
(that’s what Python’s ffi library uses). You can type man dlopen
to know how libraries are found. Setting LD_LIBRARY_PATH
is probably the easiest way.
Hello! The same issue happens when running cairoffi in a virtualenv created by pipenv, when the cairo libraries are installed using Fink. Fink on MacOs installs its libraries outside of the normal path, in /sw/lib. That path is not checked by dlopen, nor by ctypes.util.find_library(). The solution is the same: add libcairo's folder to LD_LIBRARY_PATH.
@aeveltstra Did you try to use Fink’s Python to create the virtual environment with pipenv? I don’t know how Fink works, but other tools like Homebrew tweak their Python version to make it search in the folders where its libraries are installed.
Otherwise, Python can’t magically find the libraries that are installed in non-standard paths, and setting LD_LIBRARY_PATH
is the easiest solution.
@aeveltstra Did you try to use Fink’s Python to create the virtual environment with pipenv?
I'll make sure to check that!
Hi, I've got
weasyprint
package nicely running on Ubuntu, but after deploying to the AWS Beanstalk (Amazon Linux 2) cairocffi can't find libraries.Looking for those three files within terminal I've found only the
libcairo.so.2
at/usr/lib64/libcairo.so.2
Installation with pip doesn't return any errors.
python -m pip --no-cache-dir install cairocffi
. So it seems to be installed smoothly. My first thought was that python virtual environment doesn't containPKG_CONFIG_PATH
variable. But I'm not sure what to put there.