QGIS Shapely – How to Install Shapely for Python 2.6 on Mac (Not 2.7)

qgisqgis-pluginsshapely

I'm trying to use Polygonizer plugin inside QGIS, but it needs Shapely to work. I've installed Shapely (pip install Shapely) but that's for python 2.7. QGIS works with python 2.6 (on Snow Leopard) and I can't find previous installers for it. Maybe I'm missing something?

Thanks.

Best Answer

I assume you are using the KyngChaos version of QGIS and thus the GEOS library is installed in /Library/Frameworks/GEOS.framework/

Download the Shapely Python package from PyPI or Shapely from github and untar.

Then, in the terminal:

cd -> shapely folder
LDFLAGS=`/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config --libs`
CFLAGS=`/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config --cflags` 
python setup.py install