[Python-Dev] framework build for 2.7 using old sqlite?

Doug Hellmann doug.hellmann at gmail.com
Sun Oct 3 17:29:14 CEST 2010


I'm trying to write a little program that uses the full text search extension module for sqlite with Python 2.7 on Snow Leopard.  I installed Python by downloading the DMG file from python.org.  According to the Python docs (http://docs.python.org/library/sqlite3.html#sqlite3.Connection.enable_load_extension), 2.7 should include the functions for handling extension modules, but when I try to use them they are not defined (I get an AttributeError when I call the related methods on the Connection object).

In Modules/_sqlite/connection.c I see that there is an #ifdef for HAVE_LOAD_EXTENSION, which is in turn only defined if both the version number is high enough and SQLITE_OMIT_LOAD_EXTENSION is not set.

I think the problem is that the build of Python in the DMG I download was created with an old version of the SQLite libraries:

	farnsworth:dhellmann:~:503 $ which python
	/Library/Frameworks/Python.framework/Versions/2.7/bin/python

	farnsworth:dhellmann:~:501 $ python
	Python 2.7 (r27:82508, Jul  3 2010, 21:12:11) 
	[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
	Type "help", "copyright", "credits" or "license" for more information.
	>>> import sqlite3
	>>> sqlite3.version_info
	(2, 6, 0)


Can anyone confirm that the installer image for OS X 10.5 and later (http://python.org/ftp/python/2.7/python-2.7-macosx10.5.dmg) was created with an old SQLite library?  Is there some way to update that DMG, or do I need to build Python from source myself?

Thanks,
Doug



More information about the Python-Dev mailing list