[pysqlite] Installing pysqlite on MacOS X 10.5

Brant Sears <[email protected]> Wed, 04 Feb 2009 13:24:42 -0500
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Hi folks,

I'm trying to install pysqlite on MacOS X version 10.5.6. The reason I  
am trying to install it is that I want to install Trac and I  
understand it to be a prerequisite.

I am following the instructions for install from source that I found  
here:
http://oss.itsystementwicklung.de/trac/pysqlite/browser/doc/install-source.txt

My Mac has python 2.5.1 and sqlite3 version 3.4.0 installed. I've also  
installed version 3.1 of the development tools (XCode).

So, I un-tar'd it, then I ran "python setup.py build" which looked  
like it worked. No errors and the output looked normal as far as I can  
tell. I have it saved.

Then I ran "python setup.py install" which seemed to work up until it  
got to:

error: could not create '/System/Library/Frameworks/Python.framework/ 
Versions/2.5/pysqlite2-doc': Permission denied

So, then I did: sudo !!

and things seemed to run to completion without errors.

Then I tried testing it as outlined in the instructions. There appears  
to be an error importing a sqlite3 symbol. I would appreciate any  
advice.

Here is the results from the test:

bugz:~ bot$ python
Python 2.5.1 (r251:54863, Nov 11 2008, 17:46:48)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> from pysqlite2 import test
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Python/2.5/site-packages/pysqlite2/test/ 
__init__.py", line 35, in <module>
     from pysqlite2.test import dbapi, types, userfunctions, factory,  
transactions,\
   File "/Library/Python/2.5/site-packages/pysqlite2/test/dbapi.py",  
line 27, in <module>
     import pysqlite2.dbapi2 as sqlite
   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

 >>> test.test()
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
NameError: name 'test' is not defined