Re: Installing via pip under Win7 + virtualenv + VC++2008

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Jason Erickson <jerickso(at)stickpeople(dot)com>
Cc: Stephen Lacy <slacy(at)slacy(dot)com>, psycopg(at)postgresql(dot)org
Subject: Re: Installing via pip under Win7 + virtualenv + VC++2008
Date: 2011-06-04 21:54:28
Message-ID: BANLkTimVAQo9JF4h-uYF8nDpRe2gkjTiOQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Sat, Jun 4, 2011 at 4:47 PM, Daniele Varrazzo
<daniele(dot)varrazzo(at)gmail(dot)com> wrote:

> 1) You use gcc to build python extension with prebuilt PG binaries

I have given a go at building psycopg with mingw. I've made a couple
of patches, one about dropping warnings, another to support Python 3
in autodetect_pg_config_path_windows(). Stephen, you may want to merge
it as it is in the area you are hacking on.

It works good enough, but as Jason says it builds a pyd depending on
the libpq.dll, which in turn depends on 4-5 dlls found in the
Postgres/bin directory. So the product still requires some care to be
deployed, but if the static lib is not installed by the postgres
package I guess there's little that can be done. An option would be to
copy all the dlls in the psycopg2 dir... would it be ugly?

Another problem I've had was caused by the problem described in
http://bugs.python.org/issue3308 due to an old msvcr90.lib I had in my
build system. With the buggy lib it wasn't possible to build for
Python 2.6 and 3.1.

Both the missing localtime in msvcr90.lib and the dll dependencies
have been easy to debug using the tool at
http://www.dependencywalker.com/ - without it the error messages are
painfully unhelpful.

Apart from the patches already committed in my devel, I think I'm fine
with the scenario mingw/win. I will see to add a web page about the
tools used.

-- Daniele

In response to

Browse psycopg by date

  From Date Subject
Next Message Håvard Wahl Kongsgård 2011-06-06 06:32:41 Problem with index using regular expression
Previous Message Daniele Varrazzo 2011-06-04 15:50:52 2.4.2 code ready