OpenBabel for centOS

287 views
Skip to first unread message

rppn...@gmail.com

unread,
May 8, 2017, 2:09:41 PM5/8/17
to Open Drug Discovery Toolkit Community
Dear Doctor Maciek,

I am trying to implement the ODDT software in a centOS operating system. However, I am having problems updating the openbabel python wrapper. 
I have tried to update openbabel with pip, but the result I got was this:
_________________________________________________________
Collecting openbabel
  Using cached openbabel-2.4.1.tar.gz
Building wheels for collected packages: openbabel
  Running setup.py bdist_wheel for openbabel ... error
  Complete output from command /opt/rh/python27/root/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uGxruf/openbabel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpEkTLwIpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  Warning: package openbabel-2.0 could not be found by pkg-config.
  Guessing Open Babel location:
  - include_dirs: ['/opt/rh/python27/root/usr/include/python2.7', '/usr/local/include/openbabel-2.0']
  - library_dirs: ['/opt/rh/python27/root/usr/lib64', '/usr/local/lib']
  building '_openbabel' extension
  swigging openbabel-python.i to openbabel-python_wrap.cpp
  swig -python -c++ -small -O -templatereduce -naturalvar -I/opt/rh/python27/root/usr/include/python2.7 -I/usr/local/include/openbabel-2.0 -o openbabel-python_wrap.cpp openbabel-python.i
  openbabel-python.i:225: Error: Unable to find 'openbabel/babelconfig.h'
  openbabel-python.i:227: Error: Unable to find 'openbabel/data.h'
  openbabel-python.i:228: Error: Unable to find 'openbabel/rand.h'
  openbabel-python.i:229: Error: Unable to find 'openbabel/obutil.h'
  openbabel-python.i:230: Error: Unable to find 'openbabel/math/vector3.h'
  openbabel-python.i:232: Error: Unable to find 'openbabel/math/matrix3x3.h'
  openbabel-python.i:233: Error: Unable to find 'openbabel/math/transform3d.h'
  openbabel-python.i:234: Error: Unable to find 'openbabel/math/spacegroup.h'
  openbabel-python.i:238: Error: Unable to find 'openbabel/base.h'
  openbabel-python.i:240: Error: Unable to find 'openbabel/generic.h'
  openbabel-python.i:241: Error: Unable to find 'openbabel/griddata.h'
  openbabel-python.i:243: Error: Unable to find 'openbabel/chains.h'
  openbabel-python.i:244: Error: Unable to find 'openbabel/typer.h'
  openbabel-python.i:252: Error: Unable to find 'openbabel/plugin.h'
  openbabel-python.i:257: Error: Unable to find 'openbabel/oberror.h'
  openbabel-python.i:258: Error: Unable to find 'openbabel/format.h'
  openbabel-python.i:259: Error: Unable to find 'openbabel/obconversion.h'
  openbabel-python.i:260: Error: Unable to find 'openbabel/residue.h'
  openbabel-python.i:261: Error: Unable to find 'openbabel/internalcoord.h'
  openbabel-python.i:262: Error: Unable to find 'openbabel/atom.h'
  openbabel-python.i:263: Error: Unable to find 'openbabel/bond.h'
  openbabel-python.i:264: Error: Unable to find 'openbabel/reaction.h'
  openbabel-python.i:282: Error: Unable to find 'openbabel/mol.h'
  openbabel-python.i:289: Error: Unable to find 'openbabel/ring.h'
  openbabel-python.i:290: Error: Unable to find 'openbabel/parsmart.h'
  openbabel-python.i:291: Error: Unable to find 'openbabel/alias.h'
  openbabel-python.i:292: Error: Unable to find 'openbabel/atomclass.h'
  openbabel-python.i:294: Error: Unable to find 'openbabel/fingerprint.h'
  openbabel-python.i:296: Error: Unable to find 'openbabel/descriptor.h'
  openbabel-python.i:301: Error: Unable to find 'openbabel/forcefield.h'
  openbabel-python.i:303: Error: Unable to find 'openbabel/builder.h'
  openbabel-python.i:304: Error: Unable to find 'openbabel/op.h'
  openbabel-python.i:306: Error: Unable to find 'openbabel/chargemodel.h'
  openbabel-python.i:309: Error: Unable to find 'openbabel/phmodel.h'
  openbabel-python.i:310: Error: Unable to find 'openbabel/graphsym.h'
  openbabel-python.i:311: Error: Unable to find 'openbabel/isomorphism.h'
  openbabel-python.i:312: Error: Unable to find 'openbabel/query.h'
  openbabel-python.i:313: Error: Unable to find 'openbabel/canon.h'
  openbabel-python.i:315: Error: Unable to find 'openbabel/stereo/stereo.h'
  openbabel-python.i:318: Error: Unable to find 'openbabel/bitvec.h'
  openbabel-python.i:321: Error: Unable to find 'openbabel/rotor.h'
  openbabel-python.i:323: Error: Unable to find 'openbabel/rotamer.h'
  openbabel-python.i:324: Error: Unable to find 'openbabel/spectrophore.h'
  openbabel-python.i:374: Error: Unable to find 'openbabel/obiter.h'
  stereo.i:1: Error: Unable to find 'openbabel/stereo/tetranonplanar.h'
  stereo.i:2: Error: Unable to find 'openbabel/stereo/tetraplanar.h'
  stereo.i:3: Error: Unable to find 'openbabel/stereo/tetrahedral.h'
  stereo.i:4: Error: Unable to find 'openbabel/stereo/cistrans.h'
  stereo.i:5: Error: Unable to find 'openbabel/stereo/squareplanar.h'
  stereo.i:6: Error: Unable to find 'openbabel/stereo/bindings.h'
  
  Error: SWIG failed. Is Open Babel installed?
  You may need to manually specify the location of Open Babel include and library directories. For example:
    python setup.py build_ext -I/usr/local/include/openbabel-2.0 -L/usr/local/lib
    python setup.py install
  
  ----------------------------------------
  Failed building wheel for openbabel
  Running setup.py clean for openbabel
Failed to build openbabel
Installing collected packages: openbabel
  Running setup.py install for openbabel ... error
    Complete output from command /opt/rh/python27/root/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uGxruf/openbabel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-XSI_BY-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build_ext
    Warning: package openbabel-2.0 could not be found by pkg-config.
    Guessing Open Babel location:
    - include_dirs: ['/opt/rh/python27/root/usr/include/python2.7', '/usr/local/include/openbabel-2.0']
    - library_dirs: ['/opt/rh/python27/root/usr/lib64', '/usr/local/lib']
    building '_openbabel' extension
    swigging openbabel-python.i to openbabel-python_wrap.cpp
    swig -python -c++ -small -O -templatereduce -naturalvar -I/opt/rh/python27/root/usr/include/python2.7 -I/usr/local/include/openbabel-2.0 -o openbabel-python_wrap.cpp openbabel-python.i
    openbabel-python.i:225: Error: Unable to find 'openbabel/babelconfig.h'
    openbabel-python.i:227: Error: Unable to find 'openbabel/data.h'
    openbabel-python.i:228: Error: Unable to find 'openbabel/rand.h'
    openbabel-python.i:229: Error: Unable to find 'openbabel/obutil.h'
    openbabel-python.i:230: Error: Unable to find 'openbabel/math/vector3.h'
    openbabel-python.i:232: Error: Unable to find 'openbabel/math/matrix3x3.h'
    openbabel-python.i:233: Error: Unable to find 'openbabel/math/transform3d.h'
    openbabel-python.i:234: Error: Unable to find 'openbabel/math/spacegroup.h'
    openbabel-python.i:238: Error: Unable to find 'openbabel/base.h'
    openbabel-python.i:240: Error: Unable to find 'openbabel/generic.h'
    openbabel-python.i:241: Error: Unable to find 'openbabel/griddata.h'
    openbabel-python.i:243: Error: Unable to find 'openbabel/chains.h'
    openbabel-python.i:244: Error: Unable to find 'openbabel/typer.h'
    openbabel-python.i:252: Error: Unable to find 'openbabel/plugin.h'
    openbabel-python.i:257: Error: Unable to find 'openbabel/oberror.h'
    openbabel-python.i:258: Error: Unable to find 'openbabel/format.h'
    openbabel-python.i:259: Error: Unable to find 'openbabel/obconversion.h'
    openbabel-python.i:260: Error: Unable to find 'openbabel/residue.h'
    openbabel-python.i:261: Error: Unable to find 'openbabel/internalcoord.h'
    openbabel-python.i:262: Error: Unable to find 'openbabel/atom.h'
    openbabel-python.i:263: Error: Unable to find 'openbabel/bond.h'
    openbabel-python.i:264: Error: Unable to find 'openbabel/reaction.h'
    openbabel-python.i:282: Error: Unable to find 'openbabel/mol.h'
    openbabel-python.i:289: Error: Unable to find 'openbabel/ring.h'
    openbabel-python.i:290: Error: Unable to find 'openbabel/parsmart.h'
    openbabel-python.i:291: Error: Unable to find 'openbabel/alias.h'
    openbabel-python.i:292: Error: Unable to find 'openbabel/atomclass.h'
    openbabel-python.i:294: Error: Unable to find 'openbabel/fingerprint.h'
    openbabel-python.i:296: Error: Unable to find 'openbabel/descriptor.h'
    openbabel-python.i:301: Error: Unable to find 'openbabel/forcefield.h'
    openbabel-python.i:303: Error: Unable to find 'openbabel/builder.h'
    openbabel-python.i:304: Error: Unable to find 'openbabel/op.h'
    openbabel-python.i:306: Error: Unable to find 'openbabel/chargemodel.h'
    openbabel-python.i:309: Error: Unable to find 'openbabel/phmodel.h'
    openbabel-python.i:310: Error: Unable to find 'openbabel/graphsym.h'
    openbabel-python.i:311: Error: Unable to find 'openbabel/isomorphism.h'
    openbabel-python.i:312: Error: Unable to find 'openbabel/query.h'
    openbabel-python.i:313: Error: Unable to find 'openbabel/canon.h'
    openbabel-python.i:315: Error: Unable to find 'openbabel/stereo/stereo.h'
    openbabel-python.i:318: Error: Unable to find 'openbabel/bitvec.h'
    openbabel-python.i:321: Error: Unable to find 'openbabel/rotor.h'
    openbabel-python.i:323: Error: Unable to find 'openbabel/rotamer.h'
    openbabel-python.i:324: Error: Unable to find 'openbabel/spectrophore.h'
    openbabel-python.i:374: Error: Unable to find 'openbabel/obiter.h'
    stereo.i:1: Error: Unable to find 'openbabel/stereo/tetranonplanar.h'
    stereo.i:2: Error: Unable to find 'openbabel/stereo/tetraplanar.h'
    stereo.i:3: Error: Unable to find 'openbabel/stereo/tetrahedral.h'
    stereo.i:4: Error: Unable to find 'openbabel/stereo/cistrans.h'
    stereo.i:5: Error: Unable to find 'openbabel/stereo/squareplanar.h'
    stereo.i:6: Error: Unable to find 'openbabel/stereo/bindings.h'
    
    Error: SWIG failed. Is Open Babel installed?
    You may need to manually specify the location of Open Babel include and library directories. For example:
      python setup.py build_ext -I/usr/local/include/openbabel-2.0 -L/usr/local/lib
      python setup.py install
    
    ----------------------------------------
Command "/opt/rh/python27/root/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-uGxruf/openbabel/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-XSI_BY-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-uGxruf/openbabel/
________________________________________________________________

I also tried to instal openbabel 2.4.1, and then attempt to manually create the python bindings. However, I haven't had any luck so far.
Do you have any ideas on what I can try to solve this.
Thank you very much for your work, and any ideas you may provide.

Regards,
Rui Neves

Maciek Wójcikowski

unread,
May 8, 2017, 3:31:16 PM5/8/17
to rppn...@gmail.com, Open Drug Discovery Toolkit Community
Hi Rui,

The easiest way to get OB and ODDT is via Anaconda or Miniconda. Firstly install https://conda.io/miniconda.html and then all you need to do is:
conda install -c openbabel openbabel
conda install -c mwojcikowski oddt

I didn't try to to install recent versions of Openbabel.  It should be easier, although you'll probably find more issues down the road... I'd go with conda installation as suggested above.

Let me know how it worked out for you.

----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl

--
You received this message because you are subscribed to the Google Groups "Open Drug Discovery Toolkit Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to oddt+unsubscribe@googlegroups.com.
To post to this group, send email to od...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/oddt/67fbdcf1-c2bc-488f-9ff0-0c8a88fffe25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maciek Wójcikowski

unread,
May 8, 2017, 4:10:34 PM5/8/17
to rppn...@gmail.com, Open Drug Discovery Toolkit Community
Hello again,

I followed on your problem and found a solution to manually install OB (although I highly recommend Anaconda).
I assume you have CentOS 6.x

Install epel repo:
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

Install dependencies:
yum install cmake eigen3-devel make gcc-c++ zlib-devel swig

Download and extract OpenBabel 2.4.1
Go to extracted OB folder and do the following: 
mkdir build
cd build
cmake ..
make -j4
make install # OR sudo make install 
 
And finally pip installation should work: 
pip install openbabel

To load openbabel.so (library) you need to export LD_LIBRARY_PATH with openbabel installation dir (and probably append it to ~/.bashrc):
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
 
That's it. It's much harder to debug if you run into further problems.

----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl

Reply all
Reply to author
Forward
0 new messages