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

Asked by Felipe S. S. Schneider

Hi,

(The following was previously posted at https://github.com/openbabel/openbabel/issues/1876.)

I believe the standard Ubuntu package of OpenBabel is not [compiled](http://open-babel.readthedocs.io/en/latest/Installation/install.html#compiling-open-babel) with [Eigen](http://eigen.tuxfamily.org/) (`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

Language:
English Edit question
Status:
Answered
For:
Ubuntu openbabel Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
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.

Revision history for this message
Felipe S. S. Schneider (dudektria) said :
#2

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.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Just to verify, what is the output of

sudo updatedb
locate libopenbabel.so

Revision history for this message
Felipe S. S. Schneider (dudektria) said :
#4

I get the following:

    % sudo updatedb
    [sudo] password for schneider:
    % locate libopenbabel.so
    /opt/adf2014.10/bin/openbabel/lib/libopenbabel.so
    /opt/adf2014.10/bin/openbabel/lib/libopenbabel.so.4
    /opt/adf2014.10/bin/openbabel/lib/libopenbabel.so.4.0.2
    /usr/lib/libopenbabel.so.4
    /usr/lib/libopenbabel.so.4.0.2
    /usr/local/lib/libopenbabel.so
    /usr/local/lib/libopenbabel.so.5
    /usr/local/lib/libopenbabel.so.5.0.0

Revision history for this message
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/libopenbabel.so...

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).

Revision history for this message
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.