Hello OpenBabel users,

I've been having issues with OpenBabel and thought I might use some help from 
more experienced users.
My main problem is that I have (apparently) installed OpenBabel succesfully, 
but other softwares cannot access it. For example, when I try to run a programm 
that uses OpenBabel ('mk_prepare_ligand.py -i 1iep_ligand.sdf -o 
1iep_ligand.pdbqt --pH 7.4'), I get the following error:

'Traceback (most recent call last):
  File "/home/artur/.local/bin/mk_prepare_ligand.py", line 11, in <module>
    from openbabel import openbabel as ob
ModuleNotFoundError: No module named 'openbabel''

Furthermore, if I try to remove openbabel from my system, I receive a message 
(in Portuguese, so I won't copy it here) saying that "openbabel isn't 
installed, so it won't be removed". However, I can easily execute the comand 
obabel through my Ubuntu 20.04 terminal.
Additionally, if I try the command pip install -U openbabel, I get the 
following error message:

Collecting openbabel
  Using cached openbabel-3.1.1.1.tar.gz (82 kB)
Building wheels for collected packages: openbabel
  Building wheel for openbabel (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; 
sys.argv[0] = '"'"'/tmp/pip-install-ctx5tcrx/openbabel/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-ctx5tcrx/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/pip-wheel-xzrzd_1p
       cwd: /tmp/pip-install-ctx5tcrx/openbabel/
  Complete output (66 lines):
  running bdist_wheel
  running build
  running build_ext
  Warning: invalid version number '3.1.1.1'.
  Guessing Open Babel location:
  - include_dirs: ['/usr/include/python3.8', '/usr/local/include/openbabel3']
  - library_dirs: ['/usr/local/lib']
  building 'openbabel._openbabel' extension
  swigging openbabel/openbabel-python.i to openbabel/openbabel-python_wrap.cpp
  swig -python -c++ -small -O -templatereduce -naturalvar 
-I/usr/include/python3.8 -I/usr/local/include/openbabel3 -o 
openbabel/openbabel-python_wrap.cpp openbabel/openbabel-python.i

then several errors similar to these: openbabel/openbabel-python.i:246: Error: 
Unable to find 'openbabel/babelconfig.h'
  openbabel/openbabel-python.i:248: Error: Unable to find 'openbabel/data.h'
  openbabel/openbabel-python.i:249: Error: Unable to find 'openbabel/obutil.h'

And then finally: 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/openbabel3 -L/usr/local/lib
      python setup.py install
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import 
sys, setuptools, tokenize; sys.argv[0] = 
'"'"'/tmp/pip-install-ctx5tcrx/openbabel/setup.py'"'"'; 
__file__='"'"'/tmp/pip-install-ctx5tcrx/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-record-ik_t9mkr/install-record.txt 
--single-version-externally-managed --user --prefix= --compile 
--install-headers /home/artur/.local/include/python3.8/openbabel Check the logs 
for full command output.

I have no clue as of why Swig is failing, since I have installed it perfectly. 
I don't quite understand how to execute the suggestion given after this error, 
so I don't know what to do. I tried following the instructions at 
https://open-babel.readthedocs.io/en/latest/Installation/install.html#compile-bindings,
 but maybe I did something wrong.

Would anyone be able to help me out? Any help is more than appreciated.
Thank you so much in advance!


--


Artur
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to