I’m trying to figure out what that is on OS X, but I don’t have a Mac to test on :/ BrianHicks commented Apr 27, 2013 A good goal to have! Terms Privacy Security Status Help You can't perform that action at this time. Kozea member SimonSapin commented May 1, 2013 Hi @pelegrini . hanneshapke commented Mar 12, 2014 I think so. his comment is here
import cffi; cffi.FFI().dlopen('cairo') import cffi; cffi.FFI().dlopen('cairo.2') import cffi; cffi.FFI().dlopen('libcairo') import cffi; cffi.FFI().dlopen('libcairo.2') import cffi; cffi.FFI().dlopen('libcairo.2.dylib') import cffi; cffi.FFI().dlopen('cairo.2.dylib') import cffi; cffi.FFI().dlopen('cairo.dylib') import cffi; cffi.FFI().dlopen('libcairo.dylib') nitinbodke commented Feb 1, 2014 libcairo.2.dylib and I doubt Windows/Python is automatically searching in GTK/bin. import computed_values File "/Library/Python/2.7/site-packages/weasyprint/css/computed_values.py", line 18, in
import text File "/Library/Python/2.6/site-packages/weasyprint/text.py", line 18, in
How to give Permission to create sandbox? LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and DYLD_FALLBACK_LIBRARY_PATH are. then found that starting graphite from the command line failed with missing modules. I'm not sure either that renaming the dll file to an so extension is a good thing to do. –Evert Jan 29 '15 at 9:49 Well, what I did
I do Python programming precisely in order to avoid this sort of thing. Is it one of these? (Namely libcairo-2.dll, probably.) What’s the output of import os; print(os.environ['PATH'])? I put the DLLs supplied from that page into my System32 folder. https://github.com/Kozea/cairocffi/issues/57 Unfortunately, I have not been able to make the instructions given at the Cairo site to work.
Kozea member SimonSapin commented Feb 2, 2014 Closing this as it seems solved. My environment is: "OS X: 10.8.5 Python: 2.7.2 Virtual Env: pip list cairocffi (0.5.1) ceres (0.10.0) cffi (0.8.1) Django (1.5.5) django-tagging (0.3.1) pip (1.5) pycparser (2.10) setuptools (2.0.2) Twisted (11.1.0) txAMQP Regards, Nitin. Add these lines to /opt/graphite/lib/python2.7/site-packages/cairocffi/__init__.py, before from .
I setup everything including mod_wsgi in the latest Apache. I don’t use Windows myself. You can get it with Homebrew or Macports. hanneshapke commented Mar 12, 2014 python -c 'import sys; print('\n'.join(sys.path)) /usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/pip-1.0.2-py2.7.egg /usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/PIL-1.1.6-py2.7-macosx-10.4-x86_64.egg /usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/distribute-0.6.25-py2.7.egg /usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/virtualenv-22.214.171.124-py2.7.egg /usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages/readline-126.96.36.199-py2.7-macosx-10.4-x86_64.egg /usr/local/Cellar/python/2.7.2/lib/python27.zip /usr/local/Cellar/python/2.7.2/lib/python2.7 /usr/local/Cellar/python/2.7.2/lib/python2.7/plat-darwin /usr/local/Cellar/python/2.7.2/lib/python2.7/plat-mac /usr/local/Cellar/python/2.7.2/lib/python2.7/plat-mac/lib-scriptpackages /usr/local/Cellar/python/2.7.2/lib/python2.7/lib-tk /usr/local/Cellar/python/2.7.2/lib/python2.7/lib-old /usr/local/Cellar/python/2.7.2/lib/python2.7/lib-dynload /usr/local/Cellar/python/2.7.2/lib/python2.7/site-packages What does it tell you?
I'm willing to help test instructions though, should you need a hand. this content I could be useful to put this export into ~/.profile. I am now trying to run a program (Weasyprint) that uses CFFI to load the Cairo dll (libcairo-2.dll), which I downloaded in a 64-bit version from the GTK+ web site. I just pushed v0.5.3 to PyPI with a possible fix.
Reload to refresh your session. Kozea member SimonSapin commented Feb 1, 2014 Could you try these and tell me which of them work? I read through #28 and noticed the same problem that the imports don't work. >>> import cffi; cffi.FFI().dlopen('cairo'); Traceback (most recent call last): File "
I know ctypes can, it's slower but maybe a fallback to ctypes can be a solution in this case. You signed out in another tab or window. Then, I used pip to install cairocffi.
By reading your answers, it solved by "brew install cairo"finnally lol Kozea member liZe commented Aug 26, 2016 We probably need a better documentation for OSX! Kozea member SimonSapin commented Mar 7, 2014 @colevscode Looks like it’s not. I have installed cairocffi in my virtual environment. http://cairographics.org/download/ Tell me if it works after you installed Cairo.
Maybe just mention that it might be the case that it needs to be manually linked? I am hitting following traceback. nitinbodke commented Feb 1, 2014 Sure, I will open separate issue. http://culturahq.com/cannot-load/cannot-load-library-reloc-library-1316.html warnings.warn("Options will be ignored.") Running on http://0.0.0.0:8000/ (Press CTRL+C to quit) Restarting with stat Error importing flask-weasyprint!
Kozea member SimonSapin commented Mar 12, 2014 These look like two separate issues. Below is the detailed errors: (graphite)$ python Python 2.7.2 (default, Oct 11 2012, 20:14:37) [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin Type "help", "copyright", "credits" or "license" for more import text File "c:\anaconda\envs\py33\lib\site-packages\weasyprint-0.20-py3.3.egg\weasyprint\text.py", line 18, in
Thanks! Select 2D data in a certain range Antonym for Nourish Underbrace under nested square roots C++ - why is (a % 256) different than (a & 0xFF)? From what I can tell, my version of the Cairo dll (which is the one I downloaded from the cairographics.org site) was compiled under Visual Studio 2008, which appears to be Personal Open source Business Explore Sign up Sign in Pricing Blog Support Search GitHub This repository Watch 7 Star 85 Fork 20 Kozea/cairocffi Code Issues 15 Pull requests 2 Projects
bmer commented May 28, 2015 What is the exact name of the DLL file? You signed in with another tab or window. Normally, just giving cairo to dlopen should do the trick on OS X. It's often hard to know where to go to post questions.
and continues with the path to the Python interpreter that’s used.