Re: Installing via pip under Win7 + virtualenv + VC++2008 - Mailing list psycopg

From Jason Erickson
Subject Re: Installing via pip under Win7 + virtualenv + VC++2008
Date
Msg-id 20110604084247.X70586@stickpeople.com
Whole thread Raw
In response to Re: Installing via pip under Win7 + virtualenv + VC++2008  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: Installing via pip under Win7 + virtualenv + VC++2008
List psycopg
On Fri, 3 Jun 2011, Daniele Varrazzo wrote:

> On Fri, Jun 3, 2011 at 12:07 AM, Stephen Lacy <slacy@slacy.com> wrote:
>
>> ImportError: DLL load failed: The specified module could not be found.
>
> the file _psycopg.pyd is a dll. For its relatively small size it is
> probably dynamically linked to the libpq.dll. I think the system
> either fails to find libpq.dll or some of the other dependencies (they
> are listed in the setup.py).
>
> I suggest you to use a tool to check its dll dependencies (maybe
> http://www.dependencywalker.com/ could be ok) and see if there is
> anything missing. If libpq.dll is the missing one, try putting it in a
> PATH directory or in the psycopg2 package directory.
>
> Jason, what is the default for building psycopg on windows: static or
> dynamic libpq? Is there any default setting we may change to make
> psycopg installable with pip/easy_install (if it currently fails - I
> don't know).

The default for bulding psycopg is static, but...
it is probably being linked to the dynamic library if the prebuilt
version of PostgreSQL is used.


The main difference between static and dynamic is the link library name.

When built from source, the static library is named libpq.lib and the
dynamic library is libpqdll.lib.

When using the binary distrubtion of PostgreSQL for windows, the dynamic
library is named libpq.lib (I am not aware of a static library in the
distribution).  Note that using the binary distribution will require not
only the libpq.dll in the path, but also the openssl libraries in the path
(libeay32.dll and ssleay32.dll).


Don't ask me why the name difference between source build and binary
distribution (besides to cause confusion). :)


I am probably a special case as I build everything from source.  I can see
most people building psycopg2 from source using the prebuilt PostgreSQL
binaries, so we should make sure it builds in that configuration.
Challenges I see is that 1) we should make sure that the libpq dlls are
in the path so can be found with python, 2) if a psycopg2 distribution
file is made, we would also need to include in the dlls.


-jason

>
> -- Daniele
>

psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Deadlock
Next
From: Daniele Varrazzo
Date:
Subject: Re: Installing via pip under Win7 + virtualenv + VC++2008