如何使用requirements.txt 在 Heroku python Web 应用程序中安装 Dlib?

2024-05-05

我构建了一个涉及机器学习的 Python Flask Web API,但在 Heroku 上部署它时遇到了很多挫折。

问题是,我的应用程序依赖于 Dlib (一个库),我似乎找不到在我的 Heroku 服务器中安装的方法。我正在试图解决这个问题,我可以想象其他人工智能开发人员可能会遇到这个问题。请帮我

这是我到目前为止所做的。

我尝试通过在 requests.txt 中指定 dlib==19.4.0 及其依赖项来不使用 Buildpack,但由于对 Boost 的依赖而失败。

我研究了 Dlib 的依赖关系(https://www.pyimagesearch.com/2017/03/27/how-to-install-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

所以我在我的requirements.txt 文件中包含了boost==0.1、cmake==0.7.1 和boost-py==1.00。 安装失败,这是构建日志

-----> 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

我还尝试使用 Heroku Buildpack,https://github.com/J-A-M-E-5/heroku16-buildpack-python3-opencv-dlib.git 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 https://github.com/J-A-M-E-5/heroku114-buildpack-python3-opencv-dlib.git这几乎就像 Heroku 跳过了我的requirements.txt 并只尝试安装 Buildpacks。

这是日志文件:

-----> 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

当我打开应用程序时,我得到应用程序错误带日志;

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...

我观察到,如果我在不包含这些 Buildpack 的情况下部署应用程序,则不会出现 Gunicorn 错误,但我的应用程序需要 dlib。

My 要求.txt 文件:

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 运行时.txt

python-3.6.1

My Procfile

web: gunicorn app:app --log-file -

使用 Dlib 的最新更新,将 Dlib 添加到构建包应该不再是问题,因为 Boost 依赖项已被删除https://github.com/davisking/dlib/issues/293 https://github.com/davisking/dlib/issues/293

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用requirements.txt 在 Heroku python Web 应用程序中安装 Dlib? 的相关文章

随机推荐

  • Pyramid 中基于动态用户的授权

    我正在跟进Pyramid 文档中的安全指南 http docs pylonsproject org projects pyramid 1 1 narr security html以及 wiki 教程添加授权 http docs pylons
  • jQuery AJAX JSONP 错误“意外的令牌”

    我正在尝试跨域JSONP在 Chrome 中打电话 但我总是回复 未捕获的语法错误 意外的标记 我尝试过 更改响应内容类型 设置 xhr 标头 JSON stringify 几乎是此处提供的大多数解决方案 但到目前为止没有任何效果 ajax
  • 如何在Python中打印3x3数组?

    我需要为名为 TicTackToe py 的游戏打印一个 3 x 3 数组 我知道我们可以使用以下方法以水平或垂直方式打印列表中的内容 listA a b c d e f g h i j VERTICAL PRINTING for item
  • 我们可以将 Identity Server 4 与客户端托管在同一应用程序中吗?

    我有两个关于 Identity Server 4 的直接问题 请帮助我更好地理解它们 他们是 1 为什么我们需要单独托管Identity Server 4 2 我们可以将 Identity Server 4 与客户端托管在同一应用程序中吗
  • Play服务粒度依赖错误

    我尝试对 Google Play Service 6 5 使用新的粒度依赖关系 在我的 gradle 中我设置 dependencies compile com android support appcompat v7 21 0 2 com
  • Android 计时器/计时器任务导致我的应用程序崩溃?

    只是在我的 mainActivity 的 onCreate 中测试一个简单的代码块 Timer timer2 new Timer TimerTask testing new TimerTask public void run Toast m
  • 如何将脚本的依赖项添加到 CMake 中的目标?

    链接我的程序后 我需要对其执行一些后处理 我添加了一个add custom command TARGET 效果很好 但是 这个额外的自定义命令运行一个脚本 未生成 它已签入代码库 并且我希望如果该脚本发生更改 目标将被视为过时 以便正确重建
  • 如何以“less”显示行号(GNU)

    执行的命令是什么less https linux die net man 1 less在左栏中显示行号 来自manual http unixhelp ed ac uk CGI man cgi less N 或 行号 导致在每个行的开头显示行
  • Xcode 9,我的 NSLog() 去哪里了?未显示在 Xcode 控制台或 Console.app 中

    我正在尝试在开发应用程序时进行一些基本的日志记录 我扔了一些NSLog s 到我的代码中 但没有任何内容打印到下面的 Xcode 控制台 从字面上看什么都没有 甚至没有应用程序启动时的一些启动信息等 我已将 Xcode 控制台设置为显示Al
  • 解析输入无效的 uiautomator 层次结构文件时出现意外错误

    我正在尝试使用跟踪视图检查应用程序性能的工具 但面临一些问题并且无法弄清楚 最初我使用这个命令来打开traceview E sdk android sdk tools gt monitor E calccalc 是我的traceview 日
  • Interface Builder 中的多个视图状态

    我正在处理一个有 3 种状态的屏幕 证实 Loading Error 前两个非常简单 因为只更改了标签文本 第三个比较棘手 因为我需要显示一条错误消息并在其上有一个重试按钮 另外 我希望将所有这些都放在一个控制器下 我想这是最简单的部分 问
  • 元素“sonar:sonar”的前缀“sonar”未绑定

    我有一个 build xml 文件 看起来像这样
  • JS中如何使用数组过滤对象数组? [复制]

    这个问题在这里已经有答案了 我希望你今天过得愉快 这非常简单 我有一个对象数组 我想在另一个数组的帮助下过滤掉它 场景如下图所示 var ob array a 1 col 2 abc a 2 col 2 xyz a 3 col 2 jkl
  • fullcalendar 选择回调未在移动设备中触发

    我在用全日历 https fullcalendar io 版本 2 9 1 我将日历渲染为议程周 当我从桌面上单击特定的时间段时 它会触发选择回调 但当我单击移动设备时却不会 问题是什么 selectable true select fun
  • 如何查找冻结模型的输入和输出节点

    我想使用张量流optimize for inference py来自模型动物园的冷冻模型的脚本 ssd mobilenet v1 coco 如何查找 确定模型的输入名称和输出名称 雇用张量板生成的图的版本 https i stack img
  • 三次贝塞尔曲线逆 GetPoint 方程:float for Vector <=> Vector for float

    给定结果值和四个点是否可以取回 float t 如果是这样 怎么办 public static Vector3 GetPoint Vector3 p0 Vector3 p1 Vector3 p2 Vector3 p3 float t t M
  • 如何在代码中访问 DataGridCell 的数据对象?

    基本上 我已经绑定了数据网格 使其类似于科目时间表 每行代表一个学期的科目 该学期内的每个单元格代表一个科目 我现在尝试添加拖放功能 以便您可以将其他主题拖到网格上 这将更新底层数据结构 我可以使用一些可视化树方法来查找用户将新主题拖动到的
  • 为什么要使用 Python 进行函数式编程?

    在工作中 我们过去常常以非常标准的面向对象方式来编写 Python 程序 最近 有几个人加入了功能性潮流 他们的代码现在包含更多的 lambda map 和reduce 我知道函数式语言有利于并发性 但是函数式 Python 编程真的有助于
  • 缩小并捆绑 NodeJS 项目

    没有找到关于这个主题的太多信息 是否有任何工具 gulp 用于缩小和捆绑nodejs服务器项目 包括其node module依赖项 我遇到了无法运行的情况npm install在生产机器上 我的 可执行 大小限制为最大 20 MB 你应该看
  • 如何使用requirements.txt 在 Heroku python Web 应用程序中安装 Dlib?

    我构建了一个涉及机器学习的 Python Flask Web API 但在 Heroku 上部署它时遇到了很多挫折 问题是 我的应用程序依赖于 Dlib 一个库 我似乎找不到在我的 Heroku 服务器中安装的方法 我正在试图解决这个问题