Skip to content

@tomekwojcik /

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
PythonMagick on OS X

Installing PythonMagick on OS X

  1. brew install boost - will take a lot of time and make your Mac hot
  2. brew install --with-magick-plus-plus imagemagick
  3. cd <path_to_PythonMagick_source>
  4. ./configure --with-boost=<path_to_boost_root>
  5. make
  6. make install
  7. 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.


Did you ever figure out how to solve the import problem?


I solved this problem by copying from where make install installed PythonMagick /usr/local/lib/python2.7/site-packages/PythonMagick to where Python actually looks on a OS X Lion, /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/


Just a quick note for anyone checking this in future, after successfully building PythonMagick on Mac OS X Lion I was getting:

>>> import PythonMagick
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "PythonMagick/", line 1, in <module>
from . import _PythonMagick
ImportError: cannot import name _PythonMagick

This can be fixed by changing the first line of in PythonMagick (Usually to be found in site-packages, in my case /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PythonMagick) from:

from . import _PythonMagick


import _PythonMagick

is there any howto about installing PythonMagick on mac os x? It's annoying problem.


can find ./configure file .

RemyMuhire@Muhires-MBP:~$ cd /usr/local/Cellar/imagemagick/6.8.9-8
RemyMuhire@Muhires-MBP:/usr/local/Cellar/imagemagick/6.8.9-8$ ./configure --with-boost=/usr/local/Cellar/boost/1.56.0
-bash: ./configure: No such file or directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.