Share via

Azure App Service not working, no module named uvicorn

Shaelin Murphy 20 Reputation points
2026-03-25T16:54:11.46+00:00

My Azure App Service API says that it is running, but I keep getting this error in the logs:
2026-03-25T16:49:12.1041839Z /opt/python/3.11.14/bin/python: No module named uvicorn
However, this module is in my requirements.txt and has been for some time. The app stopped working suddenly.

Why might this be happening? Since nothing else about the app has changed.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


1 answer

Sort by: Most helpful
  1. Praneeth Maddali 7,315 Reputation points Microsoft External Staff Moderator
    2026-03-26T16:09:01.1766667+00:00

    HI @Shaelin Murphy

    Thank you for confirming—that really helps narrow things down.

    Since SCM_DO_BUILD_DURING_DEPLOYMENT is already set to true and the startup command is configured, here are some other common reasons why you might still see the "No module named uvicorn" error:

    1. The WEBSITE_RUN_FROM_PACKAGE conflict happens frequently. This setting is commonly used for zip deployments and can stop the Oryx build from running, even if SCM_DO_BUILD_DURING_DEPLOYMENT is enabled. To resolve this, check Configuration > Application settings for WEBSITE_RUN_FROM_PACKAGE. If it's set to 1, remove it or change it to 0, then save and redeploy your code.
    2. Check that the Oryx build completed successfully. After redeploying, review the Log stream or Deployment logs for entries such as: Running pip install -r requirements.txt. If this step is missing or shows errors, the virtual environment (antenv) will not have uvicorn installed.
         Running pip install -r requirements.txt
      
    3. Please ensure that your deployment package does not include any local virtual environment folders such as .venv, venv, or antenv. Oryx will handle the creation and management of its own virtual environment.
    4. Please ensure that the requirements.txt file is located at the root of your deployed package and that it includes uvicorn—preferably uvicorn[standard], or uvicorn together with gunicorn.

    reference:

    https://azureossd.github.io/2022/11/24/Python-on-Linux-App-Service-and-ModuleNotFound-Errors/

    https://learn.microsoft.com/en-us/azure/app-service/configure-language-python

    https://learn.microsoft.com/en-us/azure/app-service/quickstart-python?tabs=flask%2Cwindows%2Cazure-cli%2Cazure-cli-deploy%2Cdeploy-instructions-azportal%2Cterminal-bash%2Cdeploy-instructions-zip-azcli

    If the answer is helpful,  Please do click "Accept the answer” and Yes, this can be beneficial to other community members.

    If you have any other questions, let me know in the "comments" and I would be happy to help you


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.