Import Error during Dajngo app deployment

Nikhil N 1 Reputation point

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, I tried to install "tflite-runtime" using "pip3 install --extra-index-url tflite_runtime", as well as other libraries from my requirement list and, was successful. Later when I run python migrate I get the below error.

File "/home/site/wwwroot/myapp/", line 4, in <module>
from . import views
File "/home/site/wwwroot/myapp/", line 19, in <module>
import tflite_runtime.interpreter as tflite
File "/opt/python/3.8.6/lib/python3.8/site-packages/tflite_runtime/", line 36, in <module>
from tflite_runtime import _pywrap_tensorflow_interpreter_wrapper as _interpreter_wrapper
ImportError: /lib/x86_64-linux-gnu/ 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

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

    @Nikhil N , Adding more info:

    For Django apps, App Service looks for a file named 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, 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 -

    No comments

  2. ajkuma 13,456 Reputation points Microsoft Employee

    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> - to analyze logs and collect diagnostic dumps as required.


    No comments