[Tutor] Problem with pgbd & datetime

Gabriel Farrell gsf at panix.com
Wed Jul 27 19:40:28 CEST 2005


Are you using PyGreSQL?  import pgdb works fine for me with PyGreSQL.
I'm on Debian but I assume there's a package for it for SUSE.  

gsf


On Wed, Jul 27, 2005 at 10:13:22AM -0400, Don Parris wrote:
> 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!"
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list