Re: Reg: Installation problems in psycopg2

Jason Erickson <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Tue, 14 Oct 2008, Raj K wrote:

> Hi all,
>    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

Ahh, the mysteries of distutils.  Very powerful, but strangely, not a lot 
of information available on it.  Several years back, I was making a simple 
windows script to build the psycopg packages and somehow came up with 
these gems:

     python.exe setup.py clean --all
     python.exe setup.py build_ext -L <';' separated list of additional lib 
dirs to search> -I <';' separated list of additional include dirs to 
search> bdist_wininst


I highly recommend 'clean --all' before doing anything.

From what I remember, the flags -L and -I only work with build_ext (and 
maybe build_clib).  If you want to do more (install it, build binaries, 
etc), you can place additional commands at the end of the line after the 
-L and -I flags.  Some experimentation will be required.  In a nutshell, 
many flags are only valid with a particluar command, but you can chain 
commands together (aka build the extension before building the installer) 
to get the desired results you want.


> *p.s ->  I did find one binary in
> http://www.stickpeople.com/projects/python/win-psycopg/index.html#Ver...<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)

As James noted in another message, yes, the license of the psycopg windows 
binaries that I provide is intended to be the same as psycopg itself.  I 
do not claim any additional license(s) on the software, or want to change 
it.

To clairify things in the future, I have updated the information on my 
page to point to the LICENSE file included with psycopg.


-jason
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.