I'm trying to install the WeasyPrint library on MacOS X (Sierra).
I already have Python 3 and Anaconda installed. The documentation suggests using Homebrew. Why is this necessary? Can Homebrew and Anaconda be used together in this case?
I'm trying to install the WeasyPrint library on MacOS X (Sierra).
I already have Python 3 and Anaconda installed. The documentation suggests using Homebrew. Why is this necessary? Can Homebrew and Anaconda be used together in this case?
The answer is in the dependency list. From http://weasyprint.readthedocs.io/en/latest/install.html:
WeasyPrint 0.36 depends on:
- CPython 2.7 or ≥ 3.3
- cairo [1]
- Pango
- CFFI ≥ 0.6
- lxml ≥ 3.0
- html5lib ≥ 0.999999999
- cairocffi ≥ 0.5
- tinycss2 ≥ 0.5
- cssselect ≥ 0.6
- CairoSVG ≥ 1.0.20
- Pyphen ≥ 0.8
- Optional: GDK-PixBuf [2]
Cairo, pango, and gdk-pixbuf are all native libraries written in C in association with GNOME and GDK; their native rendering layer is X11, making MacOS a feasible target, but by no means a native one; and none of the GDK, Cairo or Pango libraries ship with MacOS X.
Why is Homebrew necessary?
Because it provides an easy way to install GDK-associated libraries on MacOS X.
Is it possible to use both Anaconda and Homebrew?
Yes. It's definitely possible to build a Python module for Anaconda that uses libraries that have been installed by MacPorts.
Will installing WeasyPrint in Homebrew let me use that library in Anaconda with no further effort?
No: Those are two different Python installations. Installing WeasyPrint in Homebrew will let you use it in your Homebrew-provided Python installation(s), and will make its library dependencies available on your system, but you'll still need to reinstall it (and any dependent Python wrappers) into your Anaconda Python installation.