Re: Installation of psycopg2 - Mailing list psycopg

From Daniele Varrazzo
Subject Re: Installation of psycopg2
Date
Msg-id CA+mi_8YDfisELq9fXN7H9Z5n4bP3-+11BoOOF-h-cXXPh32eAQ@mail.gmail.com
Whole thread Raw
In response to Installation of psycopg2  (Nitesh Jain <nitesh.learning@gmail.com>)
Responses Re: Installation of psycopg2
List psycopg
On Mon, Feb 5, 2018 at 11:28 AM, Nitesh Jain <nitesh.learning@gmail.com> wrote:
> Hi Team,
>
> I am trying to connect to PostgreSQL from python.
> I have post PostgreSQL gres database version 8.1 and python 3.5 (earlier
> version for python 2.4, default installation on unix is also present)
>
> Direct internet connectivity from the organization is not allowed so I have
> to go through installation using setup.py.
>
> Now, I am facing issue when I run command
> python3.5 /usr/local/bin/psycopg2-2.7.3.2/setup.py install
>
> running build_ext building 'psycopg2._psycopg' extension creating
> build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/psycopg
> gcc*** command here In file included from psycopg/psycopgmodule.c:27:
> ./psycopg/psycopg.h:30:2: error: #error "Psycopg requires PostgreSQL client
> library (libpq) >= 9.1"
>
> I checked for path for pg_config is there in path variable as '/usr/bin/'.
>
> Can you suggest on below
> 1. How can I resolve this error?
> 2. why error say Psycopg instead of Psycopg2
> 3. will package work with PostgreSQL 8.1 database
>
> Your help will be much appreciated. Let me know if you any further inputs.
> Thanks in advance.

Hello Nitesh,

first, as a word of advice, PostgreSQL 8.1 is long unmaintained; it
would be better to update your servers to a maintained version. Anyway
I believe the choice is not yours, so let's go ahead.

Psycopg 2.7 depends on the postgres *client library* (libpq)  version
>= 9.1, so packages such as postgresql-client and libpq-dev should be
at least this version. This is independent from your server version:
once you build successfully the library on the client you will be able
to connect to any server with version >= 7.4.

So, in order to solve your problem, either you install Psycopg 2.6, or
you install the postgres client package 9.1. Both solution are
something you have to do on the client. In both cases yes, you will be
able to connect and use a server 8.1.

What's in the error message is just a typo :)

Hope this helps

-- Daniele


psycopg by date:

Previous
From: Nitesh Jain
Date:
Subject: Installation of psycopg2
Next
From: Nitesh Jain
Date:
Subject: Re: Installation of psycopg2