Import Error during Dajngo app deployment

Nikhil N 1 Reputation point
2021-03-20T19:18:11.643+00:00

I am trying to deploy my Django app on azure. While pushing my Django project to Azure git, "tflite-runtime" was not getting installed in the remote. hence I removed it from the requirement.txt and pushed it to master.
later in azureapp.xxx.x.x.x.x.webssh/host, I tried to install "tflite-runtime" using "pip3 install --extra-index-url https://google-coral.github.io/py-repo/ tflite_runtime", as well as other libraries from my requirement list and, was successful. Later when I run python mange.py migrate I get the below error.

File "/home/site/wwwroot/myapp/urls.py", line 4, in <module>
from . import views
File "/home/site/wwwroot/myapp/views.py", line 19, in <module>
import tflite_runtime.interpreter as tflite
File "/opt/python/3.8.6/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 36, in <module>
from tflite_runtime import _pywrap_tensorflow_interpreter_wrapper as _interpreter_wrapper
ImportError: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /opt/python/3.8.6/lib/python3.8/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpytho
n-38-x86_64-linux-gnu.so)

Can some please help as i am really new to all this?

Azure Web Apps
Azure Web Apps
A feature of Azure App Service used to create and deploy scalable, mission-critical web apps.
4,333 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ajkuma 13,456 Reputation points Microsoft Employee
    2021-03-22T15:38:30.233+00:00

    @Nikhil N , Adding more info:

    For Django apps, App Service looks for a file named wsgi.py within your app code, and then runs Gunicorn.

    So, you may use a custom startup command, replace <module> with the name of folder that contains wsgi.py, and add a --chdir argument if that module is not in the project root.

    Your requirements.txt file must be at the root of your repository for App Service to automatically install the necessary packages.

    As a side note, the startup script and modify all these paths relative to $APP_PATH.

    I would suggest you to try the steps outlined in this doc for customization:
    Configure a Linux Python app for Azure App Service - https://learn.microsoft.com/azure/app-service/configure-language-python#customize-build-automation

    No comments

  2. ajkuma 13,456 Reputation points Microsoft Employee
    2021-03-22T15:43:59.907+00:00

    To narrow-down/fetch more details on the error:

    Leverage App Service diagnostics from Azure Portal> navigate to your App Service app in the Azure portal -to fetch more details on the error.
    In the left navigation, click on Diagnose and solve problems – Checkout the tile for “Diagnostic Tools” > “Availability and Performance” & "Best Practices".

    Access Kudu - https://<Your app name>.scm.azurewebsites.net/ - to analyze logs and collect diagnostic dumps as required.

    80303-image.png

    No comments