trouble with import odbc

wryder at taz.cs.wcupa.edu wryder at taz.cs.wcupa.edu
Mon Dec 10 19:35:19 EST 2001


Ahh, got it!  Actually this guy got it:

http://mail.python.org/pipermail/python-list/1999-November/015613.html

Basically I named the source file itself odbc.py which was confusing python. 
One other note: it still didn't work until I explicitely specified a
database, even though it was the default database, in the DSN.  In using
Access to connect to a remote Postgres, I was able to leave "database"
blank
and it picked up the default.  Not so for python ODBC.

-Bill


In article <9v3aj4$9ke$1 at news.netmar.com>,
<wryder at taz.cs.wcupa.edu> writes:
>
>Anyone ever seen this error given the code after that:
>
> File "odbc.py", line 1, in ?
>   import dbi, odbc, sys
> File "odbc.py", line 4, in ?
>   s = odbc('postgresql/postgres/n4pk1n')
>TypeError: object of type 'module' is not callable
>-----------------
>import dbi, odbc
>
>s = odbc('postgresql/postgres/n4pk1n')
>cur = s.cursor()
>cur.execute('select * from discounts')
>print cur.description
>for tup in cur.description:
>        print tup[0], print
>while 1:
>        rec = cur.fetchmany(10)
>        if not rec: break
>        print rec
>
>
>Finding it very hard to chase stuff like this down.  What the heck does
that
>error message mean?  Maybe some nutrinos caused two bits on my hardrive to
>swap so that the module is corrupt and isn't callable?  Whatever.  Anyway,
>Thanks in advance!  wryder at taz.cs.wcupa.edu
>
>
>
> -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web 
-----
>  http://newsone.net/ -- Free reading and anonymous posting to 60,000+
groups
>   NewsOne.Net prohibits users from posting spam.  If this or other posts
>made through NewsOne.Net violate posting guidelines, email
abuse at newsone.net




 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse at newsone.net



More information about the Python-list mailing list