Thread: python3 module for accessing postgresql

python3 module for accessing postgresql

From
Andrew Gould
Date:
Does anyone have any advice regarding the selection of a Python 3
module for PostgreSQL?  The modules I've found so far are psycopg2 and
py-postgresql.  My skill level with Python is fairly basic.

Thanks,

Andrew

Re: python3 module for accessing postgresql

From
Daniele Varrazzo
Date:
On Wed, Feb 22, 2012 at 11:10 AM, Andrew Gould
<andrewlylegould@gmail.com> wrote:
> Does anyone have any advice regarding the selection of a Python 3
> module for PostgreSQL?  The modules I've found so far are psycopg2 and
> py-postgresql.  My skill level with Python is fairly basic.

Psycopg works perfectly on Python 3 and is the most used module on
Python 2, making a straightforward upgrade path.

It's probably not packaged yet by distributions, but it's fairly easy
to compile it from source:

    python3 setup.py build
    sudo python3 setup.py install

You will need the libpq and the python-dev packages installed. If
pg_config is not found in standard locations, building will fail with
a clean description of the problem and how to specify the program
location.

If you have any problem, you may get further help on the psycopg mailing list.

Cheers,

-- Daniele