On my other computer I tried installing
pysqlite-2.0.alpha2.win32-py2.3.exe and rerun my test script, it also
failed on the same error. However, when I changed the import line to:
import pysqlite2.dbapi2 as sqlite
The test script worked. However the following scripts in
\Python23\Lib\site-packages\pysqlite2\test failed to run:
dbapi.py
types.py
I have the ff result:
M:/Python23/pythonw.exe -u
"M:/Python23/Lib/site-packages/pysqlite2/test/dbapi.py"
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "M:/Python23/Lib/site-packages/pysqlite2/test/dbapi.py", line 25, in ?
import pysqlite2.dbapi2 as sqlite
ImportError: No module named pysqlite2.dbapi2
Why oh why?
On Wed, 16 Mar 2005 22:46:38 +0800, Ng Pheng Siong <[EMAIL PROTECTED]> wrote:
> On Wed, Mar 16, 2005 at 06:45:23PM +0800, cross wind wrote:
> > AttributeError: 'module' object has no attribute 'connect'
>
> Mine's installed from source.
>
> $ python2.3
> Python 2.3.4 (#1, Sep 27 2004, 11:38:44)
> [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sqlite
> >>> cx = sqlite.connect('/tmp/1.db')
> >>> cu = cx.cursor()
> >>> cu.execute('create table t1 (a,b,c)')
> >>> cu.execute('insert into t1 values (1,2,3)')
> >>> cx.commit()
> >>> cu.execute('select * from t1')
> >>> print cu.fetchall()
> [('1', '2', '3')]
>
> > ### What seems to be wrong? I have installed:
> > ### pysqlite-1.1.6.win32-py2.3.exe
>
> Packaging error?
>
> --
> Ng Pheng Siong <[EMAIL PROTECTED]>
>
> http://sandbox.rulemaker.net/ngps -+- M2Crypto, ZServerSSL for Zope, Blog
> http://www.sqlcrypt.com -+- Database Engine with Transparent AES Encryption
>