Question

I am trying to compile pyspatialite 2.6.1 using the command

sudo python setup.py install

It compiles successfully but the resulting binary is missing a symbol. When I import the dbapi2 module from it I get the following error.

Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyspatialite import dbapi2 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/dbapi2.py", line 27, in <module>
    from pyspatialite._spatialite import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/_spatialite.so, 2): Symbol not found: _iconv
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/_spatialite.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/_spatialite.so

How do I fix this error?

Was it helpful?

Solution

I have found the answer on my own. In setup.py look for a line that says:

libraries = ['geos','geos_c','proj']

Add 'iconv' to the end of that list so that it looks like this:

libraries = ['geos','geos_c','proj','iconv']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top