How to use OpenCV with Heroku

后端 未结 5 1771
渐次进展
渐次进展 2020-12-09 06:07

When I attempt to deploy my application to Heroku I receive the following error:

File \"/app/project/app/_ _init__.py\", line 22, in 

        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-09 06:47

    You can install these missing libraries taking advantage of the heroku-buildpack-apt.

    At the time of this writing, I have succesfully done it for this repo, hosted here, with the following steps:

    1. Add heroku-buildpack-apt to your buildpacks on Heroku platform
    2. Create a file named Aptfile and add the following libs: libsm6, libxrender1, libfontconfig1, libice6 (one per line). Example here.

    Edit: in newer versions of OpenCV, you need only to list python-opencv on the Aptfile, as seen in the docs.

提交回复
热议问题