FAQ
Hi all,
I am not sure whether this is the right place to ask this
question. Please let me know if it isn't.
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

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 setup.py build
python.exe setup.py 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
http://www.stickpeople.com/projects/python/win-psycopg/index.html#Version2.
But the licensing is GPL and I wont be able to use it (I am doing
coding for proprietary systems)

Search Discussions

  • Philip Semanchuk at Oct 14, 2008 at 4:03 am

    On Oct 13, 2008, at 11:52 PM, raj.indian.08 at gmail.com 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 setup.py), then the installer makes some
    best guesses at where things are. If those guesses are wrong, compile
    and link steps can fail.

    HTH
    Philip



    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 setup.py build
    python.exe setup.py 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
    http://www.stickpeople.com/projects/python/win-psycopg/index.html#Version2
    .
    But the licensing is GPL and I wont be able to use it (I am doing
    coding for proprietary systems)
    --
    http://mail.python.org/mailman/listinfo/python-list
  • Dave at Oct 14, 2008 at 12:45 pm

    <raj.indian.08 <at> gmail.com> writes:

    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

    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 -
    I don't think the lpq library comes (in the correct format) with the latest
    versions of PostgreSQL hence I had the same problem which I never resolved.

    You can get windows binaries from
    http://www.stickpeople.com/projects/python/win-psycopg/ though.

    HTH,
    Dave
  • Raj Indian 08 at Oct 14, 2008 at 1:11 pm
    Hi Philip,
    Thank you. I have posted the same in psycopg mailing list too.
    I had setup the pg_config value too, but even then the error was
    coming.

    Hi Dave,
    Thank you for the quick reply.

    Regards
    Raj K

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 14, '08 at 3:52a
activeOct 14, '08 at 1:11p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase