[Pythonmac-SIG] [pysqlite] sqlite and python
Ned Deily
nad at acm.org
Wed Mar 25 21:56:22 CET 2009
In article <2D7D319E-094D-4D0E-8DD9-9AD51056A003 at yahoo.it>,
massimo di stefano <massimodisasha at yahoo.it>
wrote:
> i followed that way too,
>
> i downloaded the bynary version for pysqlite osx intel
> i copied all the files under :
>
> /Users/Shared/source/spatialite/
> |
> bin/
> |
> lib/
> |
> include/
>
>
>
>
> in my .bash_profile i added :
>
> LD_LIBRARY_PATH=/Users/Shared/source/spatialite/lib
> export LD_LIBRARY_PATH
>
>
> then i removed and reinstalled pysqlite :
>
> sudo rm -rf /Library/Python/2.5/site-packages/pysqlite2 /Library/
> Python/2.5/site-packages/pysqlite-2.5.0-py2.5.egg-info
>
> quit terminal.app and open a new one,
> rebuild pysqlite, these the log :
>
> http://www.geofemengineering.it/pysqlite_osx_log_2.txt
>
> then in python :
>
>
> >>> from pysqlite2 import dbapi2 as sqlite
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/Library/Python/2.5/site-packages/pysqlite2/dbapi2.py", line
> 27, in <module>
> from pysqlite2._sqlite import *
> ImportError: dlopen(/Library/Python/2.5/site-packages/pysqlite2/
> _sqlite.so, 2): Symbol not found: _sqlite3_enable_load_extension
> Referenced from: /Library/Python/2.5/site-packages/pysqlite2/
> _sqlite.so
> Expected in: dynamic lookup
Ah, I see. As far as I know, pysqlite2 is just the python wrapper to a
sqlite3 library, it doesn't include sqlite3 itself. Note, the cavaet in
the spatialite install instructions:
"the sqlite3 of standard distribution [10.5] doesn't supports the
dynamic extension loading mechanism"
So I think you'll need to download the sqlite3 (amalgamation?) source
and build your own version along with pysqlite2. Hopefully, someone
with more experience with sqlite3 can give a definitive answer.
Good luck!
--
Ned Deily,
nad at acm.org
More information about the Pythonmac-SIG
mailing list