问题
I built a Python Flask web API that involves machine learning and I've had a lot of frustration deploying it on Heroku.
The problem is, my app has a dependency on Dlib ( a library) and I can't seem to find a way to install in my Heroku server. I'm losing my mind trying to fix this and I can imagine other AI developers out there who might encounter this problem. Please help me
Here is what I have done so far.
I have tried not using a Buildpack by specifying dlib==19.4.0 along with its dependencies in my requirements.txt but It fails due to a dependency on Boost.
I have researched on the dependency for Dlib (https://www.pyimagesearch.com/2017/03/27/how-to-install-dlib/);
build-essential cmake # I already have this in my requirements.txt
libgtk-3-dev
libboost-all-dev
Also,
numpy # I already have this in my requirements.txt
scipy # I already have this in my requirements.txt
sciKit-Image # I already have this in my requirements.txt
So I included boost==0.1, cmake==0.7.1 & boost-py==1.00 in my requirements.txt file. The installation failed, here's the build log
-----> Python app detected
! The latest version of Python 3 is python-3.6.2 (you are using python-3.6.1, which is unsupported).
! We recommend upgrading by specifying the latest version (python-3.6.2).
Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing python-3.6.1
-----> Installing pip
-----> Installing requirements with pip
Collecting gunicorn (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 1))
Downloading gunicorn-19.7.1-py2.py3-none-any.whl (111kB)
Collecting boost==0.1 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading boost-0.1.tar.gz
Collecting boost-py==1.0.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 3))
Downloading boost_py-1.0.0-py3-none-any.whl
Collecting click==6.7 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 4))
Downloading click-6.7-py2.py3-none-any.whl (71kB)
Collecting cmake==0.7.1 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 5))
Downloading cmake-0.7.1-cp36-cp36m-manylinux1_x86_64.whl (19.1MB)
Collecting colorthief==0.2.1 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 6))
Downloading colorthief-0.2.1-py2.py3-none-any.whl
Collecting cycler==0.10.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 7))
Downloading cycler-0.10.0-py2.py3-none-any.whl
Collecting Flask==0.12.2 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 8))
Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
Collecting Flask-Gunicorn==0.1.1 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 9))
Downloading Flask_Gunicorn-0.1.1-py3-none-any.whl
Collecting imutils==0.4.3 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 10))
Downloading imutils-0.4.3.tar.gz
Collecting itsdangerous==0.24 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 11))
Downloading itsdangerous-0.24.tar.gz (46kB)
Collecting Jinja2==2.9.6 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 12))
Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
Collecting jsonify==0.5 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 13))
Downloading jsonify-0.5.tar.gz
Collecting MarkupSafe==1.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 14))
Downloading MarkupSafe-1.0.tar.gz
Collecting matplotlib==2.0.2 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 15))
Downloading matplotlib-2.0.2-cp36-cp36m-manylinux1_x86_64.whl (14.6MB)
Collecting numpy==1.13.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 16))
Downloading numpy-1.13.0-cp36-cp36m-manylinux1_x86_64.whl (17.0MB)
Collecting olefile==0.44 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 17))
Downloading olefile-0.44.zip (74kB)
Collecting opencv-python==3.2.0.7 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 18))
Downloading opencv_python-3.2.0.7-cp36-cp36m-manylinux1_x86_64.whl (6.7MB)
Collecting Pillow==4.1.1 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 19))
Downloading Pillow-4.1.1-cp36-cp36m-manylinux1_x86_64.whl (5.7MB)
Collecting pymongo==3.4.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 20))
Downloading pymongo-3.4.0.tar.gz (583kB)
Collecting pyparsing==2.2.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 21))
Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)
Collecting python-dateutil==2.6.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 22))
Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
Collecting pytz==2017.2 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 23))
Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
Collecting six==1.10.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 24))
Downloading six-1.10.0-py2.py3-none-any.whl
Collecting Werkzeug==0.12.2 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 25))
Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)
Collecting dlib==19.7.0 (from -r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 26))
Downloading dlib-19.7.0.tar.gz (4.0MB)
Collecting Mastodon.py (from boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading Mastodon.py-1.1.1-py2.py3-none-any.whl
Collecting sqlalchemy (from boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading SQLAlchemy-1.1.14.tar.gz (5.2MB)
Collecting peppercorn (from boost-py==1.0.0->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 3))
Downloading peppercorn-0.5.tar.gz
Collecting requests (from Mastodon.py->boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading requests-2.18.4-py2.py3-none-any.whl (88kB)
Collecting urllib3<1.23,>=1.21.1 (from requests->Mastodon.py->boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading urllib3-1.22-py2.py3-none-any.whl (132kB)
Collecting idna<2.7,>=2.5 (from requests->Mastodon.py->boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading idna-2.6-py2.py3-none-any.whl (56kB)
Collecting certifi>=2017.4.17 (from requests->Mastodon.py->boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading certifi-2017.7.27.1-py2.py3-none-any.whl (349kB)
Collecting chardet<3.1.0,>=3.0.2 (from requests->Mastodon.py->boost==0.1->-r /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/requirements.txt (line 2))
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB)
Installing collected packages: gunicorn, urllib3, idna, certifi, chardet, requests, six, python-dateutil, pytz, Mastodon.py, sqlalchemy, boost, peppercorn, boost-py, click, cmake, olefile, Pillow, colorthief, cycler, itsdangerous, MarkupSafe, Jinja2, Werkzeug, Flask, Flask-Gunicorn, imutils, jsonify, pyparsing, numpy, matplotlib, opencv-python, pymongo, dlib
Running setup.py install for sqlalchemy: started
Running setup.py install for sqlalchemy: finished with status 'done'
Running setup.py install for boost: started
Running setup.py install for boost: finished with status 'done'
Running setup.py install for peppercorn: started
Running setup.py install for peppercorn: finished with status 'done'
Running setup.py install for olefile: started
Running setup.py install for olefile: finished with status 'done'
Running setup.py install for itsdangerous: started
Running setup.py install for itsdangerous: finished with status 'done'
Running setup.py install for MarkupSafe: started
Running setup.py install for MarkupSafe: finished with status 'done'
Running setup.py install for imutils: started
Running setup.py install for imutils: finished with status 'done'
Running setup.py install for jsonify: started
Running setup.py install for jsonify: finished with status 'done'
Running setup.py install for pymongo: started
Running setup.py install for pymongo: finished with status 'done'
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yongtg64/dlib/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-377kpsyp-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
Detected Python architecture: 64bit
Detected platform: linux
Configuring cmake ...
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:765 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1536 (message):
No header defined for python-py34; skipping header check
Call Stack (most recent call first):
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
-- Could NOT find Boost
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:765 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1536 (message):
No header defined for python-py35; skipping header check
Call Stack (most recent call first):
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
-- Could NOT find Boost
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:765 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1536 (message):
No header defined for python3; skipping header check
Call Stack (most recent call first):
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
-- Could NOT find Boost
CMake Warning at /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:765 (message):
Imported targets not available for Boost version
Call Stack (most recent call first):
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:869 (_Boost_COMPONENT_DEPENDENCIES)
/tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/python3.6/site-packages/cmake/data/share/cmake-3.8/Modules/FindBoost.cmake:1472 (_Boost_MISSING_DEPENDENCIES)
/tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:69 (FIND_PACKAGE)
CMakeLists.txt:9 (include)
-- Could NOT find Boost
-- Found PythonLibs: /tmp/build_910a6f43d62d0d69b0d944c5ae4b3c87/Nuelsian-deployment-0ffa4db157435edabc6f7cb904da61e2379ac163/.heroku/python/lib/libpython3.6m.a (found suitable version "3.6.1", minimum required is "3.4")
-- *****************************************************************************************************
-- To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder
-- and run these commands:
-- ./bootstrap.sh --with-libraries=python
-- ./b2
-- sudo ./b2 install
-- *****************************************************************************************************
CMake Error at /tmp/pip-build-yongtg64/dlib/dlib/cmake_utils/add_python_module:116 (message):
Boost python library not found.
Call Stack (most recent call first):
CMakeLists.txt:9 (include)
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-build-yongtg64/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
error: cmake configuration failed!
----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yongtg64/dlib/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-377kpsyp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-yongtg64/dlib/
! Push rejected, failed to compile Python app.
! Push failed
I also tried using the Heroku Buildpack, https://github.com/J-A-M-E-5/heroku16-buildpack-python3-opencv-dlib.git and https://github.com/J-A-M-E-5/heroku114-buildpack-python3-opencv-dlib.git It's almost as if Heroku skipped my requirements.txt and only tried installing the Buildpacks.
Here's the Log file:
-----> Python3 + OpenCV + DLib app detected
-----> Generating environment
Fetching...
Unpacking...
tar: This does not look like a tar archive
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
-----> Found requirements.txt, installing dependencies using pip
/app/tmp/buildpacks/6c499595b704aea0287ed02dc4cb12382496a45391b9e41bdf4fe9d946bbf725b480741dac04e7f02dbb412489937b86a1837abdc27865b9b20adfce0b360eef/bin/compile: line 78: /app/.heroku/vendor/bin/pip3: No such file or directory
-----> Creating environment variables.
-----> Buildpack installed.
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 185.4M
-----> Launching...
Released v3
https://magicmirrordotai.herokuapp.com/ deployed to Heroku
When I then open the app, I get the Application error with log;
2017-10-07T12:33:47.122379+00:00 heroku[web.1]: Starting process with command `gunicorn app:app --log-file -`
2017-10-07T12:33:49.627779+00:00 app[web.1]: bash: gunicorn: command not found
2017-10-07T12:33:49.700534+00:00 heroku[web.1]: Process exited with status 127
2017-10-07T12:33:49.713288+00:00 heroku[web.1]: State changed from starting to crashed
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
I observed that if I deploy the app without including these Buildpacks I get no error with gunicorn, but I need dlib for my app.
My requirements.txt file:
gunicorn
click==6.7
cmake==0.7.1
colorthief==0.2.1
cycler==0.10.0
Flask==0.12.2
Flask-Gunicorn==0.1.1
imutils==0.4.3
itsdangerous==0.24
Jinja2==2.9.6
jsonify==0.5
MarkupSafe==1.0
matplotlib==2.0.2
numpy==1.13.0
olefile==0.44
opencv-python==3.2.0.7
Pillow==4.1.1
pymongo==3.4.0
pyparsing==2.2.0
python-dateutil==2.6.0
pytz==2017.2
six==1.10.0
Werkzeug==0.12.2
My runtime.txt
python-3.6.1
My Procfile
web: gunicorn app:app --log-file -
回答1:
With the most recent update to Dlib, addling Dlib to your buildpack shouldn't be a problem anymore as the Boost dependency has been removed https://github.com/davisking/dlib/issues/293
回答2:
You need cmake to install dlib. To install cmake in heroku you need to buildpack cmake and set that build in order to install dlib.
You can use this buildpack for cmake heroku-buildpack-cmake
Do this in your CLI
- Login to heroku
- copy paste
heroku create --buildpack https://github.com/VovchikMonkey/heroku-buildpack-cmake.git
- And finally set the buildpack
heroku buildpacks:set https://github.com/Starkast/heroku-buildpack-cmake
- And then deploy
$ git add . $ git commit -am "make it better" $ git push heroku
master
来源:https://stackoverflow.com/questions/46622227/how-can-i-install-dlib-in-a-heroku-python-web-app-using-requirements-txt