This sounds like the bug that occurs with Open Babel 2.3.2 on OS X 10.9 and 
higher when using libc++.

It has since been fixed in the development version: 
https://github.com/openbabel/openbabel/pull/62

Probably the best solution would be to install the development version, but you 
could also try just applying that specific patch to v2.3.2.

Matt


> On 21 Jan 2015, at 15:32, Yutong Zhao <proten...@gmail.com> wrote:
> 
> The thing is, there are plugins present. It's just that one of them happens 
> to have the name of "", ie. The empty string.
> 
> It's a stochastic error that happens once every 3 times or so upon import.
> 
> On Wednesday, January 21, 2015, Noel O'Boyle <baoille...@gmail.com 
> <mailto:baoille...@gmail.com>> wrote:
> Hi Yutong Zhao,
> 
> Please send openbabel emails to openbabel-disc...@lists.sf.net <javascript:;>.
> 
> The error is because there are no plugins presents. It's true that
> pybel should have a better error message to handle this. However, if
> you don't have any plugins (e.g. formats), you will not really be able
> to use pybel for anything.
> 
> Regards,
> - Noel
> 
> On 21 January 2015 at 05:59, Yutong Zhao <proten...@gmail.com <javascript:;>> 
> wrote:
> > Hi Noel,
> >
> > I'm not sure what's the best way to get your attention, but I've had to
> > patch _getpluginnames(ptype) in pybel.py on mac.
> >
> > Occasionally it would fail with:
> >
> >>>> import pybel
> >
> > descriptors
> >
> > Traceback (most recent call last):
> >
> >   File "<stdin>", line 1, in <module>
> >
> >   File "pybel.py", line 94, in <module>
> >
> >     descs = _getpluginnames("descriptors")
> >
> >   File "pybel.py", line 84, in _getpluginnames
> >
> >     return [x.split()[0] for x in plugins]
> >
> > IndexError: list index out of range
> >
> >
> >
> > The problem is that x.split()[0] fails on an empty string (no idea why it
> > happens). So I had to add this guard:
> >
> > def _getpluginnames(ptype):
> >
> >     if sys.platform[:4] == "cli":
> >
> >         plugins = ob.VectorString()
> >
> >     else:
> >
> >         plugins = ob.vectorString()
> >
> >     ob.OBPlugin.ListAsVector(ptype, None, plugins)
> >
> >     if sys.platform[:4] == "java":
> >
> >         plugins = [plugins.get(i) for i in range(plugins.size())]
> >
> >     res = []
> >
> >     for x in plugins:
> >
> >         if len(x.split()) > 0:
> >
> >             res.append(x)
> >
> >     return res
> >
> >
> >
> > I wish I had a clue on how to debug this further, but this is a hack that
> > seems to work for now.
> >
> >
> > --
> > Yutong Zhao
> > www.proteneer.com <http://www.proteneer.com/>
> 
> 
> -- 
> Yutong Zhao
> www.proteneer.com <http://www.proteneer.com/>
> 
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet_______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to