Python ModuleNotFoundError package in azure app service Python ModuleNotFoundError package in azure app service flask flask

Python ModuleNotFoundError package in azure app service


The problem because venv not export antenv.tar.gz file into webapp

Please don't use az webapp up --sku F1 -n <app-name> -l <location-name> to Redeploy updates

Use Local Git deployment to Azure App Service :-

https://docs.microsoft.com/en-us/azure/app-service/deploy-local-git


I would check my activated environment for this kind of situation as you have already checked that the package for SQLAlchemy is already available within the folder.

What might be happening is that you're using the system pip (pip3) to install flask-sqlalchemy to the system libs and then try to use it from within your venv. What also might be happening is that you successfully install flask-sqlalchemy to your venv and then use the system python (not venv) to try to import it.

Can you try installing the package from your venv:

https://stackoverflow.com/a/59281844/6049604

Additional reference:

https://docs.microsoft.com/en-us/azure-stack/user/azure-stack-dev-start-howto-vm-python?view=azs-1910

https://www.reddit.com/r/flask/comments/9r0kmz/python_37_error_with_flasksqlalchemy/

Hope it helps.