import pybel in python error code

Peter Otten __peter__ at web.de
Fri Sep 9 07:29:59 EDT 2016


talari.gopiprashanth.gopi2 at gmail.com wrote:

> ValueError                                Traceback (most recent call
> last) <ipython-input-6-7eb32949e76e> in <module>()
>       1 from django.conf import settings
> ----> 2 import pybel
>       3 import random, os
> 
> C:\Miniconda2\lib\site-packages\pybel.py in <module>()
>      67 _obconv = ob.OBConversion()
>      68 _builder = ob.OBBuilder()
> ---> 69 informats = _formatstodict(_obconv.GetSupportedInputFormat())
>      70 """A dictionary of supported input formats"""
>      71 outformats = _formatstodict(_obconv.GetSupportedOutputFormat())
> 
> C:\Miniconda2\lib\site-packages\pybel.py in _formatstodict(list)
>      63         list = [list.get(i) for i in range(list.size())]
>      64     broken = [x.replace("[Read-only]",
>      "").replace("[Write-only]","").split(" -- ") for x in list]
> ---> 65     broken = [(x,y.strip()) for x,y in broken]
>      66     return dict(broken)
>      67 _obconv = ob.OBConversion()
> 
> ValueError: need more than 1 value to unpack

What does

>>> import openbabel
>>> [s for s in openbabel.OBConversion().GetSupportedInputFormat()
...  if s.count(" -- ") != 1]
[]

print on your machine? There is probably a string that doesn't contain the 
separator " -- " (note the space at the beginning and the end).





More information about the Python-list mailing list