Pybel attribute error

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Pybel attribute error

Kohsei Tsuji
This post has NOT been accepted by the mailing list yet.
Dear all,

I am using openbabel 2.4.1 (with python building) on OS X Yosemite 10.10.5 and python 2.7.10.
I have successfully installed openbabel using homebrew, and checked pybel module was correctly imported in python without any error.
Then, I tried to run the following python script ( to test pybel module properly works.

import pybel
mol = pybel.OBMol()
conv = pybel.OBConversion()
print mol.NumAtoms()
print mol.NumAtoms()

but when I tried to run this script I got the attribute error as follows.

Traceback (most recent call last):
  File "/Users/kohseitsuji/Desktop/", line 2, in <module>
    mol = pybel.OBMol()
AttributeError: 'module' object has no attribute 'OBMol'

I’m not sure why this error happens since I could import the pybel module in python.

How can I fix this error?  Any help would be highly appreciated.

Thank you