Can't connect Postgres to Python

John D. Tiedeman jdtiede at sstar.com
Tue Mar 16 17:47:26 EST 2004


John wrote:

>>At this point, using the command
>>   conn = psycopg.connect("dbname=personal", serialize=0)
>>from psycogq documentation, I get
>>   NameError: name 'psycopg' is not defined
>>
>>What am I missing?
>>    
>>
>
>Hi John. You need to import the module first:
>
>import psycopg
>
>You may have more errors to figure out, but this will at least get you to the
>next step.
>
>-Dave
>  
>
This is the configuration I used:
   ./configure --with-postgres/libraries=/usr/local/pgsql/lib 
--with-postgres-includes=/usr/local/pgsql/include
--with-zope=/usr/lib/Zope-2.6.2-src 
--with-mxdatetime-includes=/usr/lib/python2.2/site-packages/mx/DateTime/mxDateTime 


When I try to import psycopg, I get "no module named DateTime." I found 
that mxDateTime.so is in 
...Python2.2/site-packages/mx/DateTime/mxDateTime. Could I have the 
wrong version, do I need to put it in the Python2.3 directory, or what?





More information about the Python-list mailing list