install python openbabel package heroku

280 Views Asked by At

Trying to install openbabel on heroku. I placed this line in my requirements.txt file: openbabel==2.4.1. I normally install openbabel to my local computer using anaconda. Looks like it has a dependency named SWIG but a search online indicates SWIG can be installed using homebrew, so how can I achieve that on heroku? I'm not sure what to do. Any help is appreciated. Currently, it is giving me this error message:

remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote:        Collecting openbabel==2.4.1 (from -r /tmp/build_638971ef340164a92179a4dbad289d2c/requirements.txt (line 96))
remote:          Downloading https://files.pythonhosted.org/packages/9c/30/eb9c3d3d3b86981f6c6a7b8eceb6f4a13b9a12673efbc842b7cebe0ce39a/openbabel-2.4.1.tar.gz (74kB)
remote:        Installing collected packages: openbabel
remote:          Running setup.py install for openbabel: started
remote:            Running setup.py install for openbabel: finished with status 'error'
remote:            Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-279snh2u/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-zs8un8_p-record/install-record.txt --single-version-externally-managed --compile:
remote:            running install
remote:            running build_ext
remote:            Warning: package openbabel-2.0 could not be found by pkg-config.
remote:            Guessing Open Babel location:
remote:            - include_dirs: ['/app/.heroku/python/include/python3.6m', '/usr/local/include/openbabel-2.0']
remote:            - library_dirs: ['/usr/local/lib']
remote:            building '_openbabel' extension
remote:            swigging openbabel-python.i to openbabel-python_wrap.cpp
remote:            swig -python -c++ -small -O -templatereduce -naturalvar -I/app/.heroku/python/include/python3.6m -I/usr/local/include/openbabel-2.0 -o openbabel-python_wrap.cpp openbabel-python.i
remote:            unable to execute 'swig': No such file or directory
remote:
remote:            Error: SWIG failed. Is Open Babel installed?
remote:            You may need to manually specify the location of Open Babel include and library directories. For example:
remote:              python setup.py build_ext -I/usr/local/include/openbabel-2.0 -L/usr/local/lib
remote:              python setup.py install
remote:
remote:            ----------------------------------------
remote:        Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-279snh2u/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-zs8un8_p-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-279snh2u/openbabel/
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to chemitry-app.
remote:
To https://git.heroku.com/chemitry-app.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/chemitry-app.git'
(
0

There are 0 best solutions below