[Tutor] Problem with pgbd & datetime

Don Parris gnumathetes at gmail.com
Wed Jul 27 16:13:22 CEST 2005


O.k., I'm running SUSE Linux 9.2, Python 2.3.4, 

I have changed my DB back-end from MySQL to Postgres for the larger
feature set.  However, in attempting to load the pgdb module for use
in my script, I got this message (same when I try it at the
command-line):

>>> pgdb.connect('localhost:chaddb_a_test:donp:d1o1l2l4')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
NameError: name 'pgdb' is not defined
>>> import pgdb
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/pgdb.py", line 65, in ?
    except ImportError: import DateTime
ImportError: No module named DateTime


In the pgdb module, I found this (which matches with the traceback):
# Marc-Andre is changing where DateTime goes.  This handles it either way.
try: from mx import DateTime
except ImportError: import DateTime

Do I just need to modify pgdb.py to import datetime instead of
DateTime?  Or is there something more to this?  I could spend a fair
amount of time searching the archives.

Don
-- 
DC Parris GNU Evangelist
http://matheteuo.org/
gnumathetes at gmail.com
"Hey man, whatever pickles your list!"


More information about the Tutor mailing list