[CentralOH] virtualenv and shared library

Mark Erbaugh mark at microenh.com
Sun May 15 22:50:37 CEST 2011


On May 13, 2011, at 6:20 PM, William McVey wrote:

> 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).

Good point, but I am supporting a legacy app that uses bsddb.  Hopefully, I'll get a chance to update it this year.

> 
>> 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
> 

I'm going to give that a try.

> 
>> 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.
> 


Thanks,
Mark


More information about the CentralOH mailing list