Error when running Python 3.13 Web App: "python: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory"

Tyler Suard 0 Reputation points
2025-06-17T22:24:54.7633333+00:00

Hello, I am trying to run an Azure WebApp using the python 3.13 stack. However it won't even start up because I am getting this error:

python: error while loading shared libraries: libpython3.11.so.1.0: cannot open shared object file: No such file or directory

Why is it trying to load python 3.11? I am using python 3.13 in my environment, and I built it using Github Actions with python 3.13.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,904 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 5,220 Reputation points Microsoft External Staff Moderator
    2025-06-18T05:58:21.6366667+00:00

    Hi @Tyler Suard
    Apologize for any inconvenience caused on this.

    In your current GitHub Actions workflow, you're creating a virtual environment (venv) with:

    - name: Create and start virtual environment
      run: |
        python -m venv venv
        source venv/bin/activate
    

    Even though you're using Python 3.13 in the workflow, this local venv is not portable and should not be deployed to Azure App Service. Azure uses its own build system (Oryx) and runtime environment to run your app, and it expects to create its own virtual environment using your requirements.txt.

    Do not include the venv/ or antenv/ folder in your deployed code.

    Just deploy your code and requirements.txt ,and let Azure handle dependency installation at runtime.


Your answer

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