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
Create stub package to use cairocffi as drop in replacement for pycairo #4
Comments
Hi, I think you’re looking for cairocffi.install_as_pycairo(). What this function does is that if So if you’re using a Python library that itself uses pycairo, run this code:
… before importing that library. Every thing should just work. For a Python command-line tool where you’re not writing any Python code it’s a bit more tricky. Either:
Does this help? |
Yes, I think I'm going to have to do the latter, though I was hoping there was a way for you to distribute it that way for other folks who may not be comfortable or knowledgable enough to consider patching it themselves. Thanks for the advice! |
Yet another option is to have a
But this is more brittle because you have to make sure it takes priority over pycairo (or that pycairo is not installed, or use a virtualenv with |
Actually, that's probably easier for my case. Thanks! I did already have the virtualenv set up with that flag, and did not have pycairo set up to begin with. |
I documented this trick: http://pythonhosted.org/cairocffi/overview.html#compatibility-with-pycairo |
👍 |
I have next to no experience with Python, so I don't know if this is possible from your perspective or something I can only do locally.
I had a lot of trouble installing pycairo for use with some other Python programs that depend on it. Since I didn't write the code and did not want to keep local forks of each of the programs, I didn't want to use your recommendation to
import cairocffi as cairo
(from http://stackoverflow.com/questions/11491268/install-pycairo-in-virtualenv/14205767#14205767)In any case, I thought it would be great if there was a way to do that so you could force other packages to use cairocffi instead of pycairo.
I asked a Python programmer I know on Twitter:
So, is this something you can do at your level to make downstream consumption easy, or is it something only possible locally?
The text was updated successfully, but these errors were encountered: