Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

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
share|improve this answer
    
Thanks gene. All your assumptions are correct. I did everything as you suggested, though used "sudo python setup.py install" instead. But it still installs it for python 2.7. "Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Sh‌​apely-1.2.16-py2.7.egg" –  Pep Jan 7 '13 at 23:16
    
it is because you use the 2.7 version you have installed and not the installed version of Python on Snow Leopard which is 2.6. QGIS uses this version. It is a path problem –  gene Jan 9 '13 at 7:14

You basically have to use the corresponding versions of either easy_install or pip. Unless you installed pip in the Apple-supplied Python, it will only work with the 2.7 version (assuming you installed it there), so you must use easy_install. Try doing sudo /usr/bin/easy_install shapely, which will install shapely using the easy_install located in /usr/bin/.

Now, if you have updated your OS X to Lion or Mountain Lion, the Apple-supplied Python will be some earlier version of 2.7. Try uninstalling QGIS and then installing it again. I read somewhere that QGIS will recognize both 2.6 and 2.7 Apple-supplied Python versions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.