Hi everyone,
I met a problem while trying to use openbabel in Python. Env: python: Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) [MSC v.1500 32 bit (Intel)] on win32 obabel: Open Babel 2.4.0 -- Sep 22 2016 -- 18:19:48 OS: win10 pythong-binding: openbabel-2.4.0-cp27-cp27m-win32.whl Problem: >>> from pybel import * >>> mymol=readstring("smi","CCCC") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\pybel.py", line 199, in readstring raise ValueError("%s is not a recognised Open Babel format" % format) ValueError: smi is not a recognised Open Babel format Trying to find out what happend: >>> sorted(informats) ['CONFIG', 'CONTCAR', 'CONTFF', 'HISTORY', 'MDFF', 'POSCAR', 'POSFF', 'VASP', 'abinit', 'acesout', 'acr', 'adfout', 'alc', 'aoforce', 'arc', 'axsf', 'bgf', 'box', 'bs', 'c09out', 'c3d1', 'c3d2', 'caccrt', 'car', 'castep', 'ccc', 'cdx', 'cif', 'ck', 'crk2d', 'crk3d', 'ct', 'cub', 'cube', 'dallog', 'dalmol', 'dat', 'dmol', 'dx', 'exyz', 'fa', 'fasta', 'fch', 'fchk', 'fck', 'feat', 'fhiaims', 'fract', 'fs', 'fsa', 'g03', 'g09', 'g92', 'g94', 'g98', 'gal', 'gam', 'gamess', 'gamin', 'gamout', 'got', 'gpr', 'gro', 'gukin', 'gukout', 'gzmat', 'hin', 'inp', 'ins', 'jin', 'jout', 'log', 'lpmd', 'mcdl', 'mcif', 'mmcif', 'mmd', 'mmod', 'mold', 'molden', 'molf', 'moo', 'mop', 'mopcrt', 'mopin', 'mopout', 'mpc', 'mpo', 'mpqc', 'msi', 'nwo', 'orca', 'out', 'outmol', 'output', 'pcm', 'pdbqt', 'png', 'pos', 'pqr', 'pqs', 'prep', 'pwscf', 'qcout', 'res', 'rsmi', 'rxn', 'siesta', 'smy', 't41', 'tdd', 'text', 'therm', 'tmol', 'txt', 'txyz', 'unixyz', 'vmol', 'xsf', 'xyz', 'yob'] I found there is no smi in pybel.informats, however the Openbabel GUI can read or write smi format correctly. Where goes wrong? The pybel no loner support smi format? PS: the openbabel in python has the same problem Thank you for helps, JS Hu ------------------------------------------------------------------------------ _______________________________________________ OpenBabel-scripting mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting |
Administrator
|
Did you install the 32-bit version of Open Babel?
- Noel On 29 September 2016 at 15:07, Jianshu Hu <[hidden email]> wrote: > Hi everyone, > > I met a problem while trying to use openbabel in Python. > > Env: > python: Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 27 2016, 15:19:22) > [MSC v.1500 32 bit (Intel)] on win32 > obabel: Open Babel 2.4.0 -- Sep 22 2016 -- 18:19:48 > OS: win10 > pythong-binding: openbabel-2.4.0-cp27-cp27m-win32.whl > > Problem: >>>> from pybel import * >>>> mymol=readstring("smi","CCCC") > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "C:\Python27\lib\site-packages\pybel.py", line 199, in readstring > raise ValueError("%s is not a recognised Open Babel format" % format) > ValueError: smi is not a recognised Open Babel format > > Trying to find out what happend: > >>> sorted(informats) > ['CONFIG', 'CONTCAR', 'CONTFF', 'HISTORY', 'MDFF', 'POSCAR', 'POSFF', > 'VASP', 'abinit', 'acesout', 'acr', 'adfout', 'alc', 'aoforce', 'arc', > 'axsf', 'bgf', 'box', 'bs', 'c09out', 'c3d1', 'c3d2', 'caccrt', 'car', > 'castep', 'ccc', 'cdx', 'cif', 'ck', 'crk2d', 'crk3d', 'ct', 'cub', 'cube', > 'dallog', 'dalmol', 'dat', 'dmol', 'dx', 'exyz', 'fa', 'fasta', 'fch', > 'fchk', 'fck', 'feat', 'fhiaims', 'fract', 'fs', 'fsa', 'g03', 'g09', 'g92', > 'g94', 'g98', 'gal', 'gam', 'gamess', 'gamin', 'gamout', 'got', 'gpr', > 'gro', 'gukin', 'gukout', 'gzmat', 'hin', 'inp', 'ins', 'jin', 'jout', > 'log', 'lpmd', 'mcdl', 'mcif', 'mmcif', 'mmd', 'mmod', 'mold', 'molden', > 'molf', 'moo', 'mop', 'mopcrt', 'mopin', 'mopout', 'mpc', 'mpo', 'mpqc', > 'msi', 'nwo', 'orca', 'out', 'outmol', 'output', 'pcm', 'pdbqt', 'png', > 'pos', 'pqr', 'pqs', 'prep', 'pwscf', 'qcout', 'res', 'rsmi', 'rxn', > 'siesta', 'smy', 't41', 'tdd', 'text', 'therm', 'tmol', 'txt', 'txyz', > 'unixyz', 'vmol', 'xsf', 'xyz', 'yob'] > > I found there is no smi in pybel.informats, however the Openbabel GUI > can read or write smi format correctly. > > Where goes wrong? The pybel no loner support smi format? > > PS: the openbabel in python has the same problem > > Thank you for helps, > > JS Hu > > ------------------------------------------------------------------------------ > > _______________________________________________ > OpenBabel-scripting mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/openbabel-scripting > ------------------------------------------------------------------------------ _______________________________________________ OpenBabel-scripting mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting |
Yes, I install the 32-bit openbabel.
And yes, a lot of formats are missing. However the GUI version can handle these format very well. I think there is something wrong when binding the obabel to python in " pythong-binding: openbabel-2.4.0-cp27-cp27m- However, I am not familiar with this part. So I don't know where goes wrong. The only thing I can ensure is that the binding is for 2.40 version and python2.7 I have no idea what is going on in pybel. Sad. :( On Thu, Sep 29, 2016 at 11:00 PM, Noel O'Boyle <[hidden email]> wrote: (ccing to openbabel-discuss as this mailing list is closed) ------------------------------------------------------------------------------ _______________________________________________ OpenBabel-scripting mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting |
Problem solved!!!! DO NOT USE THE WHEEL FROM http://www.lfd.uci.edu/~gohlke/pythonlibs!!!!!!!!!!! USE THE ONE FROM PYTHON PIP!!!!!! They have the same names but not the same contents. 😤😤😤😤 On Fri, Sep 30, 2016 at 12:03 AM, Jianshu Hu <[hidden email]> wrote:
------------------------------------------------------------------------------ _______________________________________________ OpenBabel-scripting mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting |
Administrator
|
Great. Good to know what the problem was too. On 29 Sep 2016 5:43 p.m., "Jianshu Hu" <[hidden email]> wrote:
------------------------------------------------------------------------------ _______________________________________________ OpenBabel-scripting mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/openbabel-scripting |
Free forum by Nabble | Edit this page |