Good day.
I am having trouble compiling pysqlite on windows. I have managed to start compiling with quite a bit of work but now I am stuck with this error:
d:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: cannot find -lsqlite3
I have searched for possible solutions but most of the solutions are for linux.
Please help.
Thank you.
when compiling pysqlite2
from source, you need to edit the file setup.cfg
which by default should look like:
[build_ext]
#define=
#include_dirs=/usr/local/include
#library_dirs=/usr/local/lib
libraries=sqlite3
define=SQLITE_OMIT_LOAD_EXTENSION
You'll need to uncomment include_dirs
and library_dirs
(remove the #
) an make sure include_dirs
points to the directory with the sqlite3 headers, and library_dirs
to where sqlite3.dll
can be found.
Now you should be able to compile and install pysqlite2. After that, you should put sqlite3.dll
somwhere it can be found (either somewhere on the PATH
, or into Python27\Lib\site-packages\pysqlite2
)
You should be able to use import sqlite3
instead and follow this this tutorial. That worked fine for me when dealing with Sqlite3 in Python. If that package doesn't exist try upgrading your version of Python instead, because that will include other useful packages.