I using Python3.7 (Flask) webapp in Azure
also i was confirmed web app Stack runtime running Python3.7 too
The project working fine in 127.0.0.1:5000 (localhost)
When i try deployment script into azure webapp (App service)
i got this error :-
File "/home/site/wwwroot/init.py", line 2, in <module>
2019-12-16T15:50:45.275997228Z from flask_sqlalchemy import SQLAlchemy
2019-12-16T15:50:45.276001128Z ModuleNotFoundError: No module named 'flask_sqlalchemy'
i already install Flask-SQLAlchemy in venv (env) runnning
$ pip install Flask-SQLAlchemy
also i import Flask-SQLAlchemy into requirements.txt
flask_sqlalchemy==2.4.1
sqlalchemy==1.3.11
click==6.7
Flask==1.0.2
itsdangerous==0.24
Jinja2==2.10
MarkupSafe==1.0
Werkzeug==0.14.1
flask_admin==1.5.3
flask_login==0.4.1
pyodbc==4.0.27
i also run
$ pip install -r requirements.txt
my pip version is 19
$ pip -V
pip 19.0.3 from /<project_path>/venv/lib/python3.7/site-packages/pip (python 3.7)
package install in venv
$ ls venv/lib/python3.7/site-packages/
Flask-1.0.2.dist-info flask_sqlalchemy
Flask_Admin-1.5.3-py3.7.egg-info itsdangerous-0.24-py3.7.egg-info
Flask_Login-0.4.1-py3.7.egg-info itsdangerous.py
Flask_SQLAlchemy-2.4.1.dist-info jinja2
Jinja2-2.10.dist-info markupsafe
MarkupSafe-1.0-py3.7.egg-info pip
SQLAlchemy-1.3.11.dist-info pip-19.0.3.dist-info
WTForms-2.2.1.dist-info pkg_resources
Werkzeug-0.14.1.dist-info pyodbc-4.0.27.dist-info
__pycache__ pyodbc.cpython-37m-darwin.so
click setuptools
click-6.7.dist-info setuptools-40.8.0.dist-info
easy-install.pth sqlalchemy
easy_install.py werkzeug
flask wheel
flask_admin wheel-0.33.6.dist-info
flask_login wtforms
.
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://learn.microsoft.com/en-us/azure/app-service/deploy-local-git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With