Closed theCapypara closed 1 year ago
Hi and thanks for the bug report.
We can probably remove this hack now that we don’t use setuptools anymore.
I have the same problem, is there any way to solve it?
I’ve removed the workaround. Could you try to use the current master branch and tell if it works for you?
Member
Yes, it worked! I've already rewritten, using a dozen modules, but cairo is the most convenient.
Yes, it worked!
Cool! Let’s release a new version then.
The 1.6.0 version introduced an import hack, which breaks cairocffi when bundled with PyInstaller and probably also other bundling tools. The reason is this hack: https://github.com/Kozea/cairocffi/blob/master/cairocffi/ffi.py#L18C1-L22
While I'm sure it would be possible to work around this with a PyInstaller hook or similiar, I would consider this odd behavior a bug or something that should at least be documented, I could imagine this breaking in other situations also.
Example error message produced by PyInstaller when trying to start an app consuming cairocffi:
Notably this breaks, because PyInstaller would bundle the python code within the exe executable, and cairocffi now is "hardcoded" to look for the python source file at the given path.