1. <i id='HBW7y'><tr id='HBW7y'><dt id='HBW7y'><q id='HBW7y'><span id='HBW7y'><b id='HBW7y'><form id='HBW7y'><ins id='HBW7y'></ins><ul id='HBW7y'></ul><sub id='HBW7y'></sub></form><legend id='HBW7y'></legend><bdo id='HBW7y'><pre id='HBW7y'><center id='HBW7y'></center></pre></bdo></b><th id='HBW7y'></th></span></q></dt></tr></i><div id='HBW7y'><tfoot id='HBW7y'></tfoot><dl id='HBW7y'><fieldset id='HBW7y'></fieldset></dl></div>

      <legend id='HBW7y'><style id='HBW7y'><dir id='HBW7y'><q id='HBW7y'></q></dir></style></legend>

      1. <small id='HBW7y'></small><noframes id='HBW7y'>

      2. <tfoot id='HBW7y'></tfoot>
          <bdo id='HBW7y'></bdo><ul id='HBW7y'></ul>

        在 azure app 服务上运行 python dlib 库

        Run python dlib library on azure app service(在 azure app 服务上运行 python dlib 库)
          <i id='a8Vrq'><tr id='a8Vrq'><dt id='a8Vrq'><q id='a8Vrq'><span id='a8Vrq'><b id='a8Vrq'><form id='a8Vrq'><ins id='a8Vrq'></ins><ul id='a8Vrq'></ul><sub id='a8Vrq'></sub></form><legend id='a8Vrq'></legend><bdo id='a8Vrq'><pre id='a8Vrq'><center id='a8Vrq'></center></pre></bdo></b><th id='a8Vrq'></th></span></q></dt></tr></i><div id='a8Vrq'><tfoot id='a8Vrq'></tfoot><dl id='a8Vrq'><fieldset id='a8Vrq'></fieldset></dl></div>

            <tbody id='a8Vrq'></tbody>
          • <bdo id='a8Vrq'></bdo><ul id='a8Vrq'></ul>

              <legend id='a8Vrq'><style id='a8Vrq'><dir id='a8Vrq'><q id='a8Vrq'></q></dir></style></legend>

                  <tfoot id='a8Vrq'></tfoot>

                  <small id='a8Vrq'></small><noframes id='a8Vrq'>

                  本文介绍了在 azure app 服务上运行 python dlib 库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我已经为 Python 3.4 创建了一个 azure 应用服务,并使用此

                  I have created an azure app service for Python 3.4 and installed pip there using this https://bootstrap.pypa.io/get-pip.py script. Everything works fine except when I try to execute pip install dlib library the exception occurs: RuntimeError: CMake must be installed to build the following extensions: dlib

                  Is there a way to install Cmake at the machine running this app service?

                  解决方案

                  Here is the solution that worked for me:

                  Step 0. Create the Flask application in the app.py file for example like this:

                  from flask import Flask
                  import dlib
                  app = Flask(__name__)
                  
                  @app.route('/')
                  def hello_world():
                      return 'This server is running dlib version: {}'.format(dlib.__version__)
                  
                  if __name__ == '__main__':
                      app.run(debug=True,host='0.0.0.0')
                  

                  Step 1. Build a Docker file in the same folder with Python, cmake and dlib (I opted for Python 3). Here is the Dockerfile for this:

                  FROM ubuntu:latest
                  MAINTAINER Ilya Pukhov "ilya.pukhov@gmail.com"
                  RUN apt-get update -y
                  RUN apt-get install -y python3-pip 
                      python3-dev 
                      build-essential 
                      cmake
                  COPY . /app
                  WORKDIR /app
                  RUN pip3 install flask
                  RUN pip3 install dlib
                  ENTRYPOINT ["python3"]
                  CMD ["app.py"]
                  

                  Here is the readymade file at the Docker Hub https://hub.docker.com/r/garinthengineer/dlib-test-2/

                  Step 2. Create the Web app on Linux in azure, ensure that the WEBSITES_PORT variable is set to the port number on which your Flask server is listening (by default is 5000) and connect the docker file to it. You may use the Docker Hub link from the previous point. Here is a tutorial for that step https://docs.microsoft.com/en-us/azure/app-service/containers/tutorial-custom-docker-image#change-web-app-and-redeploy

                  Profit.

                  这篇关于在 azure app 服务上运行 python dlib 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Running .jl file from R or Python(从 R 或 Python 运行 .jl 文件)
                  Running Julia .jl file in python(在 python 中运行 Julia .jl 文件)
                  Using PIP in a Azure WebApp(在 Azure WebApp 中使用 PIP)
                  How to run python3.7 based flask web api on azure(如何在 azure 上运行基于 python3.7 的烧瓶 web api)
                  Azure Python Web App Internal Server Error(Azure Python Web 应用程序内部服务器错误)
                  Django channels and azure(Django 频道和天蓝色)

                  • <bdo id='Lv5eA'></bdo><ul id='Lv5eA'></ul>

                      <i id='Lv5eA'><tr id='Lv5eA'><dt id='Lv5eA'><q id='Lv5eA'><span id='Lv5eA'><b id='Lv5eA'><form id='Lv5eA'><ins id='Lv5eA'></ins><ul id='Lv5eA'></ul><sub id='Lv5eA'></sub></form><legend id='Lv5eA'></legend><bdo id='Lv5eA'><pre id='Lv5eA'><center id='Lv5eA'></center></pre></bdo></b><th id='Lv5eA'></th></span></q></dt></tr></i><div id='Lv5eA'><tfoot id='Lv5eA'></tfoot><dl id='Lv5eA'><fieldset id='Lv5eA'></fieldset></dl></div>
                        <legend id='Lv5eA'><style id='Lv5eA'><dir id='Lv5eA'><q id='Lv5eA'></q></dir></style></legend>
                        • <small id='Lv5eA'></small><noframes id='Lv5eA'>

                            <tfoot id='Lv5eA'></tfoot>
                              <tbody id='Lv5eA'></tbody>