Reg: Installation problems in psycopg2

Philip Semanchuk philip at
Tue Oct 14 06:03:55 CEST 2008

On Oct 13, 2008, at 11:52 PM, raj.indian.08 at wrote:

> Hi all,
>    I am not sure whether this is the right place to ask this
> question. Please let me know if it isn't.

The psycopg mailing list would be a better place to ask.

>    I am trying to install psycopg2 in my windows machine for
> connecting with the PostgreSQL server.
>    Since there is no binary executable*, I  am trying to build my own
> - and I am facing this issue.
> C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe:
> cannot find -lpq
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1

I've never installed psycopg on Windows but this issue comes up from  
time to time on Unix-based operating systems. The psycopg installer  
uses the pg_config application to figure out where everything is. If  
it can't execute pg_config (due to permissions or the fact that it's  
not in the path when you run, then the installer makes some  
best guesses at where things are. If those guesses are wrong, compile  
and link steps can fail.


>     After a little bit of googling, I found that this can be solved
> by -L<directory name> while linking - but I am not specifically
> linking the code. Rather, I am installing by doing the following -
>     python.exe build
>     python.exe install
>    So, I cannot find a place to include the -L option too.
>    Can somebody help me on this? I have been investigating this for
> the last 4 days - and now I cannot see any further way out.
> Regards,
> Raj
> *p.s ->  I did find one binary in
> .
> But the licensing is GPL and I wont be able to use it (I am doing
> coding for proprietary systems)
> --

More information about the Python-list mailing list