Installing PythonMagick on OS X
brew install boost
- will take a lot of time and make your Mac hotbrew install --with-magick-plus-plus imagemagick
cd <path_to_PythonMagick_source>
./configure --with-boost=<path_to_boost_root>
make
make install
python -c "import PythonMagick"
If PythonMagick build fails saying that it couldn't find -lboost_python
navigate to <path_to_boost_root>/lib/
, ln -s libboost_python-mt.dylib libboost_python.dylib
and run make again.
Tested on 10.6.8 with Python 2.6.7 (custom build). Should work with Lion running stock 2.7.
NOTE: Looks like I was too quick to call it done. The module imports but raises exceptions when used. Bummer.
I got it working. Note that in the future boost/1.59.0 will change to something else.
Download PythonMagick-0.9.12 and unzip/untar/unwhatevs
Now you need to edit
Makefile
andpythonmagick_src/Makefile
to include the boost library. You want to find two lines, one that starts withDEFAULT_INCLUDES
and the other withLDFLAGS
. Add boost paths to the end of those lines so they look something like this:DEFAULT_INCLUDES = -I. -I$(top_builddir)/config -I/usr/local/Cellar/boost/1.59.0/include
LDFLAGS = -L/usr/local/Cellar/boost-python/1.59.0/lib
Edit
__init__.py
in the PythonMagick package folder, I found it at/usr/local/lib/python2.7/site-packages/PythonMagick
. If you can't find the path, it should be at the end of the output ofmake install
, on a line like:/bin/sh ./libtool --mode=install /usr/bin/install -c _PythonMagick.la '/usr/local/lib/python2.7/site-packages/PythonMagick'
.You want to change the first line of
__init__.py
from:to:
And that should do it!