> Can you just set the BABEL_LIBDIR environment variable in your python script 
> before you import pybel or open babel?

I tried that but without success.  I believe that setting the
variable in a launcher could work, but I do not know how to do
that on Windows.  `py2exe`'s `custom-boot-script` may be the
right place here but it is not documented.


> How much of those 40MB is Open Babel, and how much is random Python
> libraries you don't need? I always strip out a ton of Python dlls
> (e.g. Tkinter, numpy) when using those tools.

I checked by setting `bundle_files` to 3 (don't bundle) and it
copied `_openbabel.pyd` that is ~110 MB (nonshared).

(shared) `libopenbabel.dll` + `libinchi.dll` + `plugin_ops` are
less than half as large.


Mathias


>> On Nov 28, 2014, at 7:03 AM, Mathias Laurin <mathias.lau...@gmail.com> wrote:
>> 
>> Hi,
>> 
>> 
>> I am including Open Babel in a Python program of mine that I
>> distribute as an exe file to Windows users thanks to py2exe. I
>> actually only need support for about 15 formats and gen2D.
>> 
>> I found I could distribute the shared version with the OB
>> plugins I need but that requires users to set BABEL_LIBDIR to my
>> program's directory, which is not acceptable.
>> 
>> What I do now is distribute the nonshared version, that contains
>> every plugin and is about 40 MB after compression.  That is OK
>> but still.
>> 
>> I had a look at
>> `http://openbabel.org/wiki/CMake#Creating_custom_static_binaries`
>> but it seems to only support pure C++ programs and not
>> py2exe/Python.
>> 
>> 
>> Any way to reduce the size of the library for py2exe?
>> Mathias


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to