Shapely and Python 2.7 ctypes

Alex Rudy alex.rudy at gmail.com
Sun Aug 19 21:53:57 PDT 2012


Hi,

I'm trying to use Shapely with python 2.7 on mountain lion, and I seem to
be having trouble with the GEOS library and python ctypes in macports:

In [1]: import shapely.geos
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-3-298ab485fd08> in <module>()
----> 1 import shapely.geos

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/shapely/geos.py in <module>()
     58     ]
     59     _lgeos = load_dll('geos_c', fallbacks=alt_paths)
---> 60     free = load_dll('c').free
     61     free.argtypes = [c_void_p]
     62     free.restype = None

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/
lib/python2.7/site-packages/shapely/geos.py in load_dll(libname, fallbacks)
     42         raise OSError(
     43             "Could not find library %s or load any of its variants
%s" % (
---> 44                 libname, fallbacks or []))
     45
     46 if sys.platform.startswith('linux'):

OSError: Could not find library c or load any of its variants []

This suggests that the macports Shapely cannot find libc on my system. Is
there an issue with my new version of Xcode? I've tried cleaning,
uninstalling and re-installing Shapely and GEOS, and other python things
seem to work.

I've tried:
- xcode-select for the new Xcode (and accepting the Xcode license!)
- re-installing python27
- re-installing GEOS and Shapely


Any ideas?

(If this isn't the right place, and I need to ask the Shapely developer,
let me know, but it feels like a MacPorts/Mountain Lion problem with libc)

Thanks,
Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-users/attachments/20120819/19b710c3/attachment.html>


More information about the macports-users mailing list