[bf1942] Using sqlite with BF2 in Windows

"Einar S. Idsø" esi at itk.ntnu.no
Fri Apr 7 19:06:02 EDT 2006

Hi Giel!

I've tried using the pysqlite module, which includes the sqlite3.dll.
This works fine in regular Windows, but I get the error message I posted
earlier when I try to import it in the BF2 engine. I've tried both
pysqlite 1 and 2, as well as versions for Py 2.3 and 2.4. Nothing works.


Giel van Schijndel wrote:
> I'm just wondering, did you use a dll-build of sqlite?
> Since I can get python to work with sqlite3 on win, but I haven't tried
> it in combination with BF2 (time, time, time, I've got too few of it).
> Cheers,
> SGT Mortis
> The Art Of Warfare <http://www.theartofwarfare.net> - BF
> The Gryphons
> "The true sign of intelligence is not knowledge but imagination."
> Einar S. Idsø schreef:
>>I understand from the lack of replies that noone else uses external
>>Python modules with BF2 in Windows? I already knew we're hitech at
>>Battlefield.no, but I thought other people/ocmmunities/companies were a
>>bit on the cutting-edge of things as well ;)
>>Einar S. Idsø wrote:
>>>For several months we have been using pysqlite with some of our BF2
>>>Python scripts to store banlists and implement an IP-based
>>>countryfilter. Pysqlite is not included with BF2's Python engine, and
>>>therefore has to be installed separately. On our Linux-hosts, this is
>>>quite easy: Simply place a copy of sqlite and _sqlite.so into bf2/admin
>>>and import sqlite in any script that needs it.
>>>The problem I am facing now is that the same doesn't work for Windows!
>>>I've tried both pysqlite2 and version 1, but I keep getting the
>>>following error when the BF2 engine tries to import sqlite:
>>>[2006-03-31 15:20:24] Traceback (most recent call last):
>>>[2006-03-31 15:20:24]   File "admin\bfno.py", line 462, in init
>>>[2006-03-31 15:20:24]     [2006-03-31 15:20:24] import standard_admin
>>>[2006-03-31 15:20:24]   File "admin\standard_admin\__init__.py", line
>>>15, in ?
>>>[2006-03-31 15:20:24]     [2006-03-31 15:20:24] import countryfilter
>>>[2006-03-31 15:20:24]   File "admin\standard_admin\countryfilter.py",
>>>line 5, in ?
>>>[2006-03-31 15:20:24]     [2006-03-31 15:20:24] import sqlite
>>>[2006-03-31 15:20:24]   File "admin\sqlite\__init__.py", line 1, in ?
>>>[2006-03-31 15:20:24]     [2006-03-31 15:20:24] import _sqlite
>>>[2006-03-31 15:20:24] ImportError[2006-03-31 15:20:24] : [2006-03-31
>>>15:20:24] Don't know how to import _sqlite (type code 3)
>>>Just typing "import sqlite" in IDLE (Python shell in Windows) works fine.
>>>Does anyone have any idea how to include external Python modules for
>>>Windows BF2?

More information about the Bf1942 mailing list