ModuleNotFoundError: No module named 'arcpy'

mohamed benayad 1 Reputation point
2022-04-13T14:59:31.287+00:00

Hello,

Due to the error (mentioned in the title) that appeared during an Azure function deployement using Visual Studio Code, concerning the ArcGISPro library (arcpy).

I tried to solve it by following this document : https://learn.microsoft.com/en-us/azure/azure-functions/bring-dependency-to-functions?pivots=programming-language-python#bring-dependencies-by-mounting-a-file-share , but it still persist .

So,I'm wondering if there is any way to fix this issue.
please find out the attached screenshots

Thank you

192706-azure-function-error-arcpy.jpg

192774-azure-function-modul-error-arcpy

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,931 Reputation points
    2022-04-18T04:08:18.967+00:00

    @mohamed benayad Thanks for reaching out. As you are using arcpy module in your azure function and when there is a missing dependency, you should see the error message below in application insights (as per your logs shared) that you have configured for your function app. Whenever you receive 500 errors then you can always navigate to application insights logs to get more details on the actual exception in the case of 500 or any error code.
    No module named 'arcpy'

    If you have any requirement where you need to use any other packages that are not predefined in the functions, then you need to add the names or names (If the modules can be installed using pip) along with versions of the required packages to the requirements.txt file.
    But in case if those module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.

    To troubleshoot these types of errors you can always refer to this document.

    0 comments No comments