How to fix the pyodbc not found error in Azure function app

Manoj J 20 Reputation points
2025-02-01T09:50:33.4533333+00:00

Our application, which had been running smoothly for over a month, suddenly stopped working, displaying a "pyodbc not found" error. Despite trying various solutions, including version changes, we've been unable to resolve the issue. This error is blocking our project progress, and we urgently need assistance to fix it.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,398 questions
{count} votes

Accepted answer
  1. Shireesha Eeraboina 1,555 Reputation points Microsoft Vendor
    2025-02-03T09:56:16.46+00:00

    Hi @Manoj J,

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    To resolve the "pyodbc not found" error in your Azure Function app, make sure that the pyodbc package is properly included in your deployment. Here are some steps you can take:

    • Ensure that pyodbc is included in your requirements.txt file. If it is missing, add it and then redeploy your function app.
    • Make sure you are using the latest version of pyodbc. You can specify a version in your requirements.txt file, such as pyodbc>=4.0.32, to prevent issues associated with older versions.
    • Use the command func azure functionapp publish <app-name> to deploy your function app. Make sure you have the latest version of Azure Functions Core Tools installed.
    • If you continue to experience issues, it could be due to a ModuleNotFoundError. This may happen if the package is not correctly resolved for the Linux environment. Verify that your package is compatible with Linux and that there are no conflicts with other packages.
    • If you are manually publishing your package, make sure that both SCM_DO_BUILD_DURING_DEPLOYMENT and ENABLE_ORYX_BUILD are set to true in your application settings.

    By following these steps, you should be able to fix the "pyodbc not found" error and get your application up and running once more.

    For your reference, please review the following documentation for further clarification:

    I hope this helps! Let me know if you have any further questions or need additional assistance.


0 additional answers

Sort by: Most helpful

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.