Download psycopg2 at http://initd.org/pub/software/psycopg/

To install  (I’m using the version 2.0.10) you need to run two commands:

# python setup.py build

and after the build is complete:

# python setup.py install

Well, but it’s not so easy if you do not have the dependencies already installed.In my case I got errors like:

NameError: global name ‘w’ is not defined psycopg2

or

error: Setup script exited with error: command ‘gcc’ failed with exit status 1

To solve this I have to install the libpq-dev library and the python development package:

# apt-get install libpq-dev

# apt-get install python2.5-dev

After that I just run the usual python setup.py install and all done.

Comente

*
*