[DB-SIG] Where's datetime?

Marco A. Gonzalez marcoinc at mac.com
Sun Apr 5 06:20:26 CEST 2009


I'm a newcomer to Python and excited about using with a database, but  
I can't get one to work despite how easy it purports to be.

After installing Python 3.0.1, and PostgreSQL 8.3 and py-postgresql  
v0.8.0, and doing the following from the command line:

 >>> import postgresql
 >>> db = postgresql.open("pq://localhost/postgres")

I get "ImportError: No module named datetime". Upon further  
inspection, I see that the protocol directory just doesn't have a  
datetime file.

Did I miss installing something?  Can someone tell me what I'm doing  
wrong?

[mbp120computer:Development/Python/py-postgresql-0.8.0] marco% python3.0
Python 3.0.1 (r301:69597, Feb 14 2009, 19:03:52)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import postgresql
 >>> db = postgresql.open("pq://localhost/postgres")
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "postgresql/__init__.py", line 53, in open
     from . import driver as pg_driver
   File "postgresql/driver/__init__.py", line 10, in <module>
     from .pq3 import Driver
   File "postgresql/driver/pq3.py", line 35, in <module>
     from ..protocol import typio as pg_typio
   File "postgresql/protocol/typio.py", line 56, in <module>
     from ..python.datetime import UTC, FixedOffset
ImportError: No module named datetime
 >>>

[mbp120computer:py-postgresql-0.8.0/postgresql/python] marco% ls
__init__.py     decorlib.pyc    functools.py    itertools.pyc
__init__.pyc    doc.py          functools.pyc   optimized.c
decorlib.py     doc.pyc         itertools.py    socket.py
[mbp120computer:py-postgresql-0.8.0/postgresql/python] marco%




------------------------------------------------------
Marco A. Gonzalez, President
Amagavi, Inc.
Developer of database-driven web sites

web: http://www.amagavi.com/
email on iPhone: marcoinc at mac.com
email on laptop: marco at amagavi.com
cell: 202-222-5137






More information about the DB-SIG mailing list