![](/img/trans.png)
[英]Requirements.txt causes an error when I'm deploying my Django app to the Azure web app service
[英]Missing “gcc” error when trying to deploy a flask app with requirements.txt to Azure Web App from VSCode
From within VSCode, using the Azure web service extension, I can deploy a Hello-World flask app successfully to my Azure web app (linux, python 3.6 stack).
當我嘗試部署我真正的 flask 應用程序(在 requirements.txt 中列出了依賴項)文件時,我將“pip install --upgrade -r requirements.txt”指定為 web 應用程序“啟動命令”,在 Z3AF580F1422203677 中瀏覽web 應用程序頁面給出“應用程序錯誤”。
我的 web 應用程序的日志顯示,由於錯誤無法執行 'gcc': No such file or directory ,嘗試構建“psutil”時啟動代碼失敗。
當上述失敗時,我還嘗試使用“輪子”作為我的部署的一部分,如此處所述( https://blogs.msdn.microsoft.com/azureossds/2015/06/29/install-native-python-modules-on -azure-web-apps-api-apps/ ),但這似乎並沒有改變任何東西(同樣的“缺少 gcc”錯誤)。
這是從 VSCode 部署具有 python 庫依賴項的 flask 應用程序的正確方法嗎? 我希望部署過程會自動處理 requirements.txt(無需指定啟動命令),並且我希望它能夠安裝 python 庫而不會出錯。
Due to you were using Azure WebApp for Linux based on Docker Container, the MSDN blog Install Python Modules on Azure App Services
for Azure WebApp for Windows is not useful for your issue.
因此,對於您缺少gcc
錯誤的問題,根據我的經驗,解決該問題的解決方案是配置一個自定義 Linux 容器,該容器已預先安裝 gcc 到您的應用程序代碼鏈中。
作為參考,請嘗試遵循以下文檔。
gcc
工具鏈,方法是更改 Docker 文件,如安裝所述openssh
作為Enable SSH
部分。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.