Sunday, 27 August 2017

qgis - How to install shapely for python 2.6 (Mac) NOT 2.7?


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.



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

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...