no module found

Wassim Louiz 1 Reputation point
2022-02-17T14:06:09.147+00:00

I am facing a problem while deploying an azure Timer Trigger function.
In fact i wrote a code in which i run another external python file, locally it works normally but when i deploy it i get an error ( module not found error ) even though i checked the module is installed. I thought this might be caused by the path but I am not quite sure.
How can i fix this error and deploy it !?

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

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,511 Reputation points
    2022-02-18T04:14:57.423+00:00

    @Wassim Louiz ,

    Thanks for the details provided in comments.

    The default Python project will force a remote build on deployment. This can be changed, or checked, by looking at the settings.json file in the .vscode directory. The setting: "azureFunctions.scmDoBuildDuringDeployment": true, determiens if you are going to do a remote or local build.

    Assuming this is still set to true, you should be using Oryx to do a remote build and installing the packages within the requirements.txt. If you are still seeing errors when doing a remote build, you should confirm that your requirements.txt is setup correctly, and what package(s) you are having issues with. Another thing to confirm is that the local .venv python version matches the python version you are running on the Azure function, mismatches in the python version used to install the modules, and what we are running on in Azure can cause issues with Modules not Found.

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


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.