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: marco...@mac.com
email on laptop: ma...@amagavi.com
cell: 202-222-5137




_______________________________________________
DB-SIG maillist  -  DB-SIG@python.org
http://mail.python.org/mailman/listinfo/db-sig

Reply via email to