AttributeError: module 'openbabel' has no attribute 'OBConformerSearch'

Asked by Felipe S. S. Schneider on 2018-07-31


(The following was previously posted at

I believe the standard Ubuntu package of OpenBabel is not [compiled]( with [Eigen]( (`libeigen2-dev` in Ubuntu). This would make `OBConformerSearch` not available. Is this expected?

## Environment Information
Open Babel version: 2.4.1
Operating system and version: Ubuntu 18.04.1 LTS (Kernel 4.15.0-29-generic x86_64)

## Steps to Reproduce

I get the following when trying to use `OBConformerSearch` from `pybel.ob`.

    % ipython
    Python 3.6.5 (default, Apr 1 2018, 05:46:30)
    Type 'copyright', 'credits' or 'license' for more information
    IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

    In [1]: import pybel

    In [2]: cs = pybel.ob.OBConformerSearch()
    AttributeError Traceback (most recent call last)
    <ipython-input-2-abbf488f9f28> in <module>()
    ----> 1 cs = pybel.ob.OBConformerSearch()

    AttributeError: module 'openbabel' has no attribute 'OBConformerSearch'

    In [3]:

The same happens with Python 2.7.15rc1 and IPython 5.7.0.
I'm using `openbabel-2.4.1` as installed using `pip`.

Compiling OpenBabel with Eigen and using the resulting bindings results in no error.

Shouldn't OpenBabel be compiled with Eigen by default?

Question information

English Edit question
Ubuntu openbabel Edit question
No assignee Edit question
Last query:
Last reply:
Manfred Hampl (m-hampl) said : #1

If you have installed openbabel via pip, then you are not using the Ubuntu-provided version, and we cannot help.

Sorry, I think I wasn't clear: the pip package binds to a library installed with apt-get (libopenbabel4v5), which seems not to be compiled with Eigen. By compiling both the library and the bindings the error disappears.

Manfred Hampl (m-hampl) said : #3

Just to verify, what is the output of

sudo updatedb

I get the following:

    % sudo updatedb
    [sudo] password for schneider:
    % locate

Manfred Hampl (m-hampl) said : #5

You seem to have three different versions of the libopenbabel library and should check which one is really used.

The ubuntu-provided one is /usr/lib/

As far as I can see the buildlog of the libopenbabel* package shows a dependecy on libeigen3-dev and compiler options -DHAVE_EIGEN and -DHAVE_EIGEN3

The one in /usr/local/lib seems to have a higher version number. Maybe that is what you need.
The version currently in development for Ubuntu 18.10 also has .so.5 at the end. Maybe you just need to wait for Ubuntu 16.10 (or even use its development version already now).

Manfred Hampl (m-hampl) said : #6

Oops, typo error, should of course read Ubuntu 18.10 instead of 16.10

Can you help with this problem?

Provide an answer of your own, or ask Felipe S. S. Schneider for more information if necessary.

To post a message you must log in.