Goodman-lab / DP5

Python workflow for DP5 and DP4 analysis of organic molecules
Other
175 stars 102 forks source link

openbabel #64

Closed flatstik closed 2 years ago

flatstik commented 2 years ago

I have openbabel 3.1.1 installed via apt on debian 11 (bullseye). Still PyDP4.py insists I don't have it. If I try to install openbabel via pip3, I get the following:

pip3 install openbabel
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-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/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-53b7i0si
       cwd: /tmp/pip-install-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/
  Complete output (15 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.9', '/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.9 -I/usr/local/include/openbabel3 -o openbabel/openbabel-python_wrap.cpp openbabel/openbabel-python.i

  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: 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
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/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-avjb7oqq/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/plastik/.local/include/python3.9/openbabel
         cwd: /tmp/pip-install-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/
    Complete output (14 lines):
    running install
    running build_ext
    Warning: invalid version number '3.1.1.1'.
    Guessing Open Babel location:
    - include_dirs: ['/usr/include/python3.9', '/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.9 -I/usr/local/include/openbabel3 -o openbabel/openbabel-python_wrap.cpp openbabel/openbabel-python.i

    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-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/setup.py'"'"'; __file__='"'"'/tmp/pip-install-0iqgadow/openbabel_16d90c56e02244508217be3d20b0dfa6/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-avjb7oqq/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/plastik/.local/include/python3.9/openbabel Check the logs for full command output.

After installing the libopenbabel-dev -package the includes are to be found from the directory /usr/include/openbabel3/openbabel , not from /usr/local/include/openbabel3

Jonathan-Goodman commented 2 years ago

This is an issue with pip and openBabel, not with DP4. I do not think we can help with this.