Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find existing windows path #153

Closed
Houdinic opened this issue Apr 10, 2020 · 2 comments
Closed

Cannot find existing windows path #153

Houdinic opened this issue Apr 10, 2020 · 2 comments

Comments

@Houdinic
Copy link

I am using windows 10 and dlopen output that there's no "cairo" or "cairo-2". When using ctypes.util.find_library(), I found it could output the correct path of libcairo-2.dll. After commenting out ffi.dlopen(path) and returning path directly, it works with the returned path.
This is my code change in dlopen function.

"""Try various names for the same library, for different platforms."""
for name in names:
    for lib_name in [name, 'lib' + name]:
        try:
            path = ctypes.util.find_library(lib_name)
            if path:
                return path
                # lib = ffi.dlopen(path)
                # if lib:
                #     return lib
        except OSError:
            pass
raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
@liZe
Copy link
Member

liZe commented Apr 11, 2020

Hello!

The code you’ve modified comes from an old version on cairocffi. Version 1.1.0 probably fixes this problem, you should upgrade cairocffi.

See #119, #135.

@Houdinic
Copy link
Author

Thank you for updating me on that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants