Форум сайта python.su
Привет!
Возникла проблема с установкой драйвера SQLite на virtualenv.
1. При попытке собрать и установить с помощью easy-install получаю следующую ошибку:
C:\Pylons>C:\Pylons\env\Scripts\easy_install.exe pysqlite
Searching for pysqlite
Reading http://pypi.python.org/simple/pysqlite/
Reading http://pysqlite.googlecode.com/
Reading http://code.google.com/p/pysqlite/downloads/list
Best match: pysqlite 2.6.3
Downloading http://pysqlite.googlecode.com/files/pysqlite-2.6.3.tar.gz
Processing pysqlite-2.6.3.tar.gz
Running pysqlite-2.6.3\setup.py -q bdist_egg --dist-dir c:\docume~1\c7ec~1\locals~1\temp\easy_install-nemjx4\pysqlite-2.6.3\egg-dist-tmp-fppand
module.c
c:\documents and settings\username\local settings\temp\easy_install-nemjx4\pysqlite-2.6.3\src\connection.h(33) : fatal error C1083: Cannot open include fi
le: 'sqlite3.h': No such file or directory
error: Setup script exited with error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2
Офлайн
Нашел sqlite3.h в составе The SQLite Amalgamation (http://www.sqlite.org/sqlite-amalgamation-3070500.zip) на странице загрузок SQLite (http://www.sqlite.org/download.html), скачал. Затем скачал pysqlite-2.6.3.tar.gz (http://code.google.com/p/pysqlite/downloads/list), распаковал и скопировал содержимое The SQLite Amalgamation в директорию pysqlite-2.6.3\src, запустил установку командой
C:\Pylons\env\Scripts\python setup.py install
C:\Pylons\pysqlite-2.6.3>C:\Pylons\env\Scripts\python setup.py install
running install
running build
running build_py
running build_ext
building 'pysqlite2._sqlite' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DMODULE_NAME=\"pysqlite2.dbapi2\" -DSQLITE_OMIT_LOAD_EXTENSION=
1 -IC:\python26\include -IC:\Pylons\env\PC /Tcsrc/module.c /Fobuild\temp.win32-2.6\Release\src/module.obj
module.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DMODULE_NAME=\"pysqlite2.dbapi2\" -DSQLITE_OMIT_LOAD_EXTENSION=
1 -IC:\python26\include -IC:\Pylons\env\PC /Tcsrc/connection.c /Fobuild\temp.win32-2.6\Release\src/connection.obj
connection.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DMODULE_NAME=\"pysqlite2.dbapi2\" -DSQLITE_OMIT_LOAD_EXTENSION=
1 -IC:\python26\include -IC:\Pylons\env\PC /Tcsrc/cursor.c /Fobuild\temp.win32-2.6\Release\src/cursor.obj
cursor.c
...
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DMODULE_NAME=\"pysqlite2.dbapi2\" -DSQLITE_OMIT_LOAD_EXTENSION=
1 -IC:\python26\include -IC:\Pylons\env\PC /Tcsrc/row.c /Fobuild\temp.win32-2.6\Release\src/row.obj
row.c
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Pylons\env\libs /LIBPATH:C:\Pylons\env\PCbuild sqlite3.lib
/EXPORT:init_sqlite build\temp.win32-2.6\Release\src/module.obj build\temp.win32-2.6\Release\src/connection.obj build\temp.win32-2.6\Release\src/cursor.obj bui
ld\temp.win32-2.6\Release\src/cache.obj build\temp.win32-2.6\Release\src/microprotocols.obj build\temp.win32-2.6\Release\src/prepare_protocol.obj build\temp.win
32-2.6\Release\src/statement.obj build\temp.win32-2.6\Release\src/util.obj build\temp.win32-2.6\Release\src/row.obj /OUT:build\lib.win32-2.6\pysqlite2\_sqlite.p
yd /IMPLIB:build\temp.win32-2.6\Release\src\_sqlite.lib /MANIFESTFILE:build\temp.win32-2.6\Release\src\_sqlite.pyd.manifest
LINK : fatal error LNK1181: cannot open input file 'sqlite3.lib'
error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1181
Офлайн
А зачем вы ставите SQLite, елси он и так в стандарной библиотеке?
Офлайн
Ох, похоже, я очень невнимательно прочитал этот абзац:
Once you have installed, configured, and started the RDBMS you want to use, you need to install the appropriate DB-API 2.0 driver. In the case of SQLite, this is very easy because the software is automatically included with Python 2.5 or newer. If you are using Python 2.4 or older, you will need to install the driver in the same way you would for any RDBMS.Спасибо, Александр!
Офлайн