azure-functions-python-worker
azure-functions-python-worker copied to clipboard
[Bug] Python Function V1 apps - Exception: ModuleNotFoundError: No module named '__app__.XXX'. Cannot find module.
Expected Behavior
Python Function Apps using V1 programming model that are:
- Import modules from right paths following https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=asgi%2Capplication-level&pivots=python-mode-configuration#import-behavior
- Not defining app as a module explicitly in your function app or importing app(.xxx.yy) module from dependency packages. should run without seeing this issue in production.
Actual Behavior
It is reported from customers Exception: ModuleNotFoundError: No module named 'app.XXX'. Cannot find module. gets raised during customers' v1 python apps function loading time intermittently and restarting the app will resolve the error. We have trouble reproducing it and can't confirm at this moment if this is a customer code issue or platform issue.
Steps to Reproduce
No response
Relevant code being tried
No response
Relevant log output
No response
requirements.txt file
No response
Where are you facing this problem?
Production Environment (explain below)
Function app name
No response
Additional Information
Please let us know if you encountered this issue in your python function v1 apps and would really appreciate if you can share your experience and code snippet under this announcement which helps a lot with python function team's investigation.