简体   繁体   English

在Azure上部署Python Flask出现错误500

[英]Deploying Python Flask on Azure Get error 500

In the following hour's i tried to deploy Python with flask on Microsoft azure platform. 在接下来的一个小时里,我尝试在Microsoft azure平台上将Python与flask一起部署。

I used New app "flask", assign with their server. 我使用了新的应用程序“ flask”,并为其分配了服务器。 deployed by git. 由git部署。 after deployment finished (its showed Unable to find vcvarsall.bat) Then I set up on options that i am using python 3.4 version and it fixed it up. 部署完成后(它显示无法找到vcvarsall.bat),然后设置了我正在使用python 3.4版本的选项,并对其进行了修复。

After Deployment succeeds I tried to see the site and I got : Failed to load resource: the server responded with a status of 500 (Internal Server Error) 部署成功后,我尝试查看该站点,但我得到:加载资源失败:服务器响应,状态为500(内部服务器错误)

I am a beginner in deploying and I search up all over. 我是部署的初学者,我到处搜索。 I really wish somebody could help me find the right answer. 我真的希望有人能帮助我找到正确的答案。

Thank you very much. 非常感谢你。

Based on my research on this blog which mentioned content below about your issue: 根据我对此博客的研究,该博客在下面提到了有关您的问题的内容:

When you see "unable to find vcvarsall.bat", it means you're installing a package that has an extension module, but only the source code. 当您看到“无法找到vcvarsall.bat”时,表明您正在安装的软件包具有扩展模块,但只有源代码。 "vcvarsall.bat" is part of the compiler in Visual Studio that is necessary to compile the module. “ vcvarsall.bat”是Visual Studio中编译器的一部分,对模块进行编译是必需的。

I think your issue occurred because that during the flask project deployed to azure, pip has problems installing the lxml library.As mentioned in this document , lxml library is written in C which requires a compiler before it's installation. 我认为发生您的问题是因为在将flask项目部署到azure期间,pip无法安装lxml库。如本文档所述lxml库是用C编写的,安装前需要编译器

Unfortunately,a compiler is not available on the machine running the web app in Azure App Service. 不幸的是,在Azure App Service中运行Web应用程序的计算机上没有编译器。 So, you need to do this compilation locally. 因此,您需要在本地进行此编译。 You can follow the steps as below: 您可以按照以下步骤操作:

Step 1 :Use pip wheel command line to generate .whl file of lxml package.In addition,you can directly download generated .whl file here . 第1步 :使用pip wheel命令行生成lxml包的.whl文件。此外,您可以在此处直接下载生成的.whl文件。

在此处输入图片说明

Step2 :Create the wheelhouse folder under the requments.txt file's sibling directory and put the .whl file in wheelhouse folder. 步骤2 :在requments.txt文件的同级目录下创建wheelhouse文件夹,然后将.whl文件放入.whl文件夹中。

Step3 : Edit your requirements.txt to add the --find-links option at the top. 步骤3 :编辑您的requirements.txt,在顶部添加--find-links选项。

--find-links wheelhouse
lxml==3.8.0

Step4 :Deploy your flask project to azure. 第4步 :将烧瓶项目部署为天蓝色。

For more details , please refer to the Troubleshooting - Package Installation chapter in the official document and wheel document . 有关更多详细信息,请参阅官方文档wheel文档中的“ 故障排除-软件包安装”一章。

Hope it helps you. 希望对您有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tika在Azure Python Flask上抛出错误500 - Tika on Azure Python Flask throwing error 500 "使用 FastCGI 在 IIS 中部署 Python Web 应用程序(Flask)得到 500 内部服务器错误" - Deploying Python web app (Flask) in IIS using FastCGI get 500 Internal Server Error 如何使用 Python 和 Flask 摆脱 500 内部服务器错误? - How to get rid of 500 Internal Server Error using Python and Flask? 在Azure上部署python Azure函数时,获取未找到模块错误 - When deploying python Azure function on azure get No module found error 将 Python Flask 应用程序部署到 Azure 应用程序服务时出现错误 ModuleNotFoundError: No module named 'spacy' - While Deploying Python Flask App to Azure App Service getting error ModuleNotFoundError: No module named 'spacy' jQuery Ajax get和flask的错误500 - error 500 with jquery ajax get and flask Flask 收到 500 内部服务器错误 - Flask get an 500 Internal Server Error 在 IIS 上运行 Python Flask 应用程序时出现错误 500。 如何获得实际错误 - Error 500 while running a Python Flask application on IIS. How to get the actual error 使用Visual Studio在Azure上部署python flask项目 - deploying python flask project on azure using visual Studio Flask请求最终在Azure上出现500服务器错误 - Flask request ends up in 500 server error on Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM