Cygwin Python and sqlite3
Monday, 8 September 2008
Apparently, cygwin’s distribution of Python 2.5.1 doesn’t come with sqlite3. This is a pity for those who would like to work with Django using cygwin Python.
Building _sqlite3.dll on cygwin is not too difficult. If you are in a hurry, heres the download _sqlite3.dll.
Prerequisites
- /bin/cygsqlite3-0.dll
- /bin/libpython2.5.dll
- /usr/include/sqlite3.h
- /usr/include/python2.5/Python.h [et.c]
tar jxf Python-2.5.2.tar.bz2 Python-2.5.2/Modules/_sqlite/ cd Python-2.5.2/Modules/_sqlite/ gcc -shared -o _sqlite3.dll -I /usr/include/python2.5 -L /bin -lpython2.5 -lsqlite3-0 -D'MODULE_NAME="_sqlite3"' *.c cp _sqlite3.dll /usr/lib/python2.5/lib-dynload/
download
_sqlite3.dll
Update 10 Sept 2008
Download link fixed. (Thanks Steve)
You should follow me on twitter here
No. 1 — September 8th, 2008 at 2:26 pm
I think your download link is incomplete. I’m getting a very polite 404 from it, anyway.
No. 2 — September 10th, 2008 at 8:56 am
Brilliant! Thanks.
No. 3 — October 21st, 2008 at 1:15 pm
If you download the precompiled dll, be sure to run “chmod 770 _sqlite3.dll”. If the permissions are wrong, Django will fall back to the old pysqlite2 and complain about not finding *that*, obscuring the actual error from sqlite3. Thanks, Chui.
No. 4 — October 21st, 2008 at 1:21 pm
Sorry, that last sentence appears to be sarcastic but I really mean it — thank you! :)
No. 5 — October 21st, 2008 at 10:30 pm
You are welcome
No. 6 — October 23rd, 2008 at 8:18 pm
I have been looking for solution for exactly this problem for a month until I found this!
Thanks!!
No. 7 — March 28th, 2009 at 9:02 pm
Quick note that if you didn’t install SQLite3 when setting up Cygwin, you need to install it. Rerun setup.exe and locate the SQLite3 Library package under databases. This will give you the first prerequisite (/bin/cygsqlite3-0.dll). Didn’t take me too long to figure that out, but hopefully this will save someone a few minutes down the road.
Thanks for the post – it provided exactly the information I needed!
No. 8 — April 27th, 2009 at 10:28 am
Actually, I don’t think this is required anymore if you just install the sqlite3 package Django works fine.
No. 9 — April 27th, 2009 at 5:03 pm
Thanks Jon. I’ll update my copy.