Kozea / cairocffi

CFFI-based cairo bindings for Python.
https://doc.courtbouillon.org/cairocffi
BSD 3-Clause "New" or "Revised" License
208 stars 54 forks source link

Update __init__.py #221

Closed Li-Xiang-Ideal closed 8 months ago

Li-Xiang-Ideal commented 1 year ago

Python 3.8+ no longer searches for DLLs in PATH. Add paths in PATH manually. See PyCairo Windows Python3.8 Import Issue

liZe commented 8 months ago

Thank you!

I’ve simplified the code a little bit and used a specific environment variable called CAIROCFFI_DLL_DIRECTORIES instead of PATH (because the use of PATH was removed on purpose).

I’ve also updated the documentation.

alexvoss commented 7 months ago

Hi, is there a timeline for when this fix might see a release? If I understand correctly, this fixes something for Windows users that was introduced in Python 3.8, so a fair while back. I guess people must have been working around this themselves? Would be nice if there was a canonical way of addressing this.

liZe commented 7 months ago

A new version has been released.

alexvoss commented 7 months ago

Thanks for releasing this. It works for me when adding the new environment variable. However, I am puzzled how a change introduced in Python 3.8 has these repercussions only now?

liZe commented 7 months ago

However, I am puzzled how a change introduced in Python 3.8 has these repercussions only now?

Almost all CairoCFFI users are on Linux, I suppose that’s why.

alexvoss commented 7 months ago

And many on Windows are using WSL or MSYS2? Just found this evening that using Python on MSYS2 just works with just the Path set. Thanks for the info.

liZe commented 7 months ago

And many on Windows are using WSL or MSYS2? Just found this evening that using Python on MSYS2 just works with just the Path set. Thanks for the info.

Yes, MSYS2 is a great way to get DLLs easily installed, maintained and usable on Windows.

eigen2017 commented 4 months ago

A new version has been released.

new release? do you mean cairocffi 171? i upgraded to 171 and issue still.. i'm on windows 10 OSError: no library called "cairo-2" was found

liZe commented 4 months ago

new release? do you mean cairocffi 171?

Yes (actually, even 1.7.0).

Did you set CAIROCFFI_DLL_DIRECTORIES as explained in this PR and in the documentation?