[Qgis-user] Problems with Shapely instalation, using the Console

gene martin.laloux at gmail.com
Sun Sep 29 00:55:54 PDT 2013


It is a recurrent question: Shapely is a Python module and not a QGIS plugin.
Therefore you must use the terminal (Terminal.app) and not the QGIS python
console to install shapely.

If you use the QGIS version of Kyng Chaos, this version uses the default
Apple Python (modules in /Library/Python/2.x/site-packages/) and not other
versions (Homebrew, MacPorts, Anaconda, etc.)

So you can use (one of the three options)

      - pip install shapely
      - easy_install shapely
      - Download the Shapely Python package from PyPI or Shapely from github
and untar. Then, opening the terminal in the shapely folder: python setup.py
install
        
This install the Plain-Python version:

      >>> import shapely
      >>> shapely.__version__
      '1.2.18'

      >>> import shapely.speedups
      >>> print shapely.speedups.available
      False

If you want to install the speedups-enabled version, the procedure was
described by Paul Smith:  How to install GDAL, OGR and Shapely on Mac OS X
Lion 10.7
<http://tumblr.pauladamsmith.com/post/17663153373/howtoinstallgdalshapely>  
and others on GIS StackExchange (it is the same for Snow Leopard and
Mountain Lion)

As Shapely use the GEOS library which is installed in
/Library/Frameworks/GEOS.framework/, you need to fix the paths 

LDFLAGS=`/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config
--libs` 
CFLAGS=`/Library/Frameworks/GEOS.framework/Versions/3/unix/bin/geos-config
--cflags` 

So

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

and 
	
      >>> import shapely.speedups
      >>> print shapely.speedups.available
      True





--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Problems-with-Shapely-instalation-using-the-Console-tp5080745p5080756.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list