[CentralOH] virtualenv and shared library
William McVey
wam at cisco.com
Sat May 14 00:20:08 CEST 2011
On Fri, 2011-05-13 at 17:24 -0400, Mark Erbaugh wrote:
> On the Mac with OSX 10.6 (Snow Leopard), it appears that the install
> of bsddb is broken. If you try to run a script that uses bsddb, you
> get an error that it can't find _bsddb.so. If you look in the
> lib-dynload directory under site-packages, sure enough, that library
> is missing. I found a suggestion on the web that copying _bsddb.so
> from the ActiveState python install fixes that, and at least I no
> longer get the can't find error.
>
Considering bsddb is deprecated, you may want to consider other storage
options (a buddy of mine has recently finished a project using
Kyotocabinet for key/value storage, and was very happy with it).
> I'm using virtualenv to install extra python libraries on my Mac and
> I'm trying to keep the default Python as close to that as originally
> supplied by Apple. While under site-packages in the virtualenv, there
> is a lib-dynload directory, but it is just a link to the default one.
> Is there a place to install shared libraries that will be unique to a
> given virtualenv?
I install python-ldap pretty frequently into virtualenvs, and the .so
file ends up getting placed at the top level of site-packages. For
example:
PATH_TO_VIRTUALENV_ROOT/lib/python2.6/site-packages/_ldap.so
However, I also see that some packages install their .so within the egg
directory of the package itself. For example:
PATH_TO_VIRTUALENV_ROOT/lib/python2.6/site-packages/psycopg2/_psycopg.so
and
PATH_TO_VIRTUALENV_ROOT/lib/python2.6/site-packages/lxml-2.3beta1-py2.6-linux-i686.egg/lxml/etree.so
> P.S. Is anyone interested in using virtualenv's with Eclipse/Pydev? It
> appears that recent versions have built-in support that seems to be
> working.
Sorry, I'm a wingide and/or vi guy...
-- William
P.S. Looking at other virtualenvs, I see that _ldap.so is also sometimes
dropped into the python_ldap egg directory (similar to how lxml handles
it). Guess the behavior changed in different versions of the software.
More information about the CentralOH
mailing list