pysqlite2をインストール

PythonSQLiteモジュールをインストール。ものはここにあります。最新の2.4.1をダウンロード。展開してsetup.py buildを起動するとエラーになりました。

# /usr/local/bin/python setup.py install
running install
running build
running build_py
running build_ext
building 'pysqlite2._sqlite' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -I/usr/local/include/python2.4 -c src/module.c -o build/temp.solaris-2.9-sun4u-2.4/src/module.o
In file included from src/module.c:24:
src/connection.h:33:21: error: sqlite3.h: No such file or directory
In file included from src/module.c:24:
src/connection.h:38: error: expected specifier-qualifier-list before 'sqlite3'
In file included from src/module.c:25:
src/statement.h:37: error: expected specifier-qualifier-list before 'sqlite3'
src/module.c: In function 'module_complete':
src/module.c:92: warning: implicit declaration of function 'sqlite3_complete'
src/module.c: At top level:
src/module.c:222: error: 'SQLITE_OK' undeclared here (not in a function)
src/module.c:223: error: 'SQLITE_DENY' undeclared here (not in a function)
src/module.c:224: error: 'SQLITE_IGNORE' undeclared here (not in a function)
src/module.c:225: error: 'SQLITE_CREATE_INDEX' undeclared here (not in a function)
src/module.c:226: error: 'SQLITE_CREATE_TABLE' undeclared here (not in a function)
src/module.c:227: error: 'SQLITE_CREATE_TEMP_INDEX' undeclared here (not in a function)
src/module.c:228: error: 'SQLITE_CREATE_TEMP_TABLE' undeclared here (not in a function)
src/module.c:229: error: 'SQLITE_CREATE_TEMP_TRIGGER' undeclared here (not in a function)
src/module.c:230: error: 'SQLITE_CREATE_TEMP_VIEW' undeclared here (not in a function)
src/module.c:231: error: 'SQLITE_CREATE_TRIGGER' undeclared here (not in a function)
src/module.c:232: error: 'SQLITE_CREATE_VIEW' undeclared here (not in a function)
src/module.c:233: error: 'SQLITE_DELETE' undeclared here (not in a function)
src/module.c:234: error: 'SQLITE_DROP_INDEX' undeclared here (not in a function)
src/module.c:235: error: 'SQLITE_DROP_TABLE' undeclared here (not in a function)
src/module.c:236: error: 'SQLITE_DROP_TEMP_INDEX' undeclared here (not in a function)
src/module.c:237: error: 'SQLITE_DROP_TEMP_TABLE' undeclared here (not in a function)
src/module.c:238: error: 'SQLITE_DROP_TEMP_TRIGGER' undeclared here (not in a function)
src/module.c:239: error: 'SQLITE_DROP_TEMP_VIEW' undeclared here (not in a function)
src/module.c:240: error: 'SQLITE_DROP_TRIGGER' undeclared here (not in a function)
src/module.c:241: error: 'SQLITE_DROP_VIEW' undeclared here (not in a function)
src/module.c:242: error: 'SQLITE_INSERT' undeclared here (not in a function)
src/module.c:243: error: 'SQLITE_PRAGMA' undeclared here (not in a function)
src/module.c:244: error: 'SQLITE_READ' undeclared here (not in a function)
src/module.c:245: error: 'SQLITE_SELECT' undeclared here (not in a function)
src/module.c:246: error: 'SQLITE_TRANSACTION' undeclared here (not in a function)
src/module.c:247: error: 'SQLITE_UPDATE' undeclared here (not in a function)
src/module.c:248: error: 'SQLITE_ATTACH' undeclared here (not in a function)
src/module.c:249: error: 'SQLITE_DETACH' undeclared here (not in a function)
src/module.c: In function 'init_sqlite':
src/module.c:376: warning: implicit declaration of function 'sqlite3_libversion'
src/module.c:376: warning: passing argument 1 of 'PyString_FromString' makes pointer from integer without a cast
error: command 'gcc' failed with exit status 1
#

sqlite3.hが無いといっています。そうか、SQLitepythonバインディグだから、SQLiteの本体が先に入ってないといけません。ということでSQLiteをインストール。ここからたどって最新の3.5.9をダウンロードしてインストール。configure,make,make installでOK。

SQLiteをインストール後、再度pysqliteでsetup.py build,installで完了。