I am deploying a Flask+Python Web App with Azure for Students subscription. My app.py script requires the PIL module to create images. This is the error when deployed.
2021-04-20T13:19:50.963135215Z Generating gunicorn
command for 'app:app'
2021-04-20T13:19:51.119268243Z Writing output script to '/opt/startup/startup.sh'
2021-04-20T13:19:51.820980650Z Using packages from virtual environment antenv located at /tmp/8d903fede05f842/antenv.
2021-04-20T13:19:51.821975968Z Updated PYTHONPATH to ':/tmp/8d903fede05f842/antenv/lib/python3.8/site-packages'
2021-04-20T13:19:52.765695658Z [2021-04-20 13:19:52 +0000] [36] [INFO] Starting gunicorn 20.0.4
2021-04-20T13:19:52.773141593Z [2021-04-20 13:19:52 +0000] [36] [INFO] Listening at: http://0.0.0.0:8000 (36)
2021-04-20T13:19:52.774407716Z [2021-04-20 13:19:52 +0000] [36] [INFO] Using worker: sync
2021-04-20T13:19:52.784877605Z [2021-04-20 13:19:52 +0000] [38] [INFO] Booting worker with pid: 38
2021-04-20T13:19:53.168684556Z [2021-04-20 13:19:53 +0000] [38] [ERROR] Exception in worker process
2021-04-20T13:19:53.168741357Z Traceback (most recent call last):
2021-04-20T13:19:53.168754857Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2021-04-20T13:19:53.168782758Z worker.init_process()
2021-04-20T13:19:53.168791558Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
2021-04-20T13:19:53.168799358Z self.load_wsgi()
2021-04-20T13:19:53.168806658Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2021-04-20T13:19:53.168814258Z self.wsgi = self.app.wsgi()
2021-04-20T13:19:53.168821858Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-04-20T13:19:53.168829358Z self.callable = self.load()
2021-04-20T13:19:53.168836459Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2021-04-20T13:19:53.168843859Z return self.load_wsgiapp()
2021-04-20T13:19:53.168851059Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2021-04-20T13:19:53.168858559Z return util.import_app(self.app_uri)
2021-04-20T13:19:53.168865559Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
2021-04-20T13:19:53.168872859Z mod = importlib.import_module(module)
2021-04-20T13:19:53.168880059Z File "/opt/python/3.8.6/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-20T13:19:53.168887559Z return _bootstrap._gcd_import(name[level:], package, level)
2021-04-20T13:19:53.168894760Z File "", line 1014, in _gcd_import
2021-04-20T13:19:53.168902660Z File "", line 991, in _find_and_load
2021-04-20T13:19:53.168910160Z File "", line 975, in _find_and_load_unlocked
2021-04-20T13:19:53.168917760Z File "", line 671, in _load_unlocked
2021-04-20T13:19:53.168925160Z File "", line 783, in exec_module
2021-04-20T13:19:53.168932760Z File "", line 219, in _call_with_frames_removed
2021-04-20T13:19:53.168940160Z File "/tmp/8d903fede05f842/app.py", line 2, in
2021-04-20T13:19:53.168947661Z from PIL import Image, ImageDraw, ImageFont
2021-04-20T13:19:53.168954861Z ModuleNotFoundError: No module named 'PIL'
2021-04-20T13:19:53.185655363Z [2021-04-20 13:19:53 +0000] [38] [INFO] Worker exiting (pid: 38)
2021-04-20T13:19:53.258869789Z [2021-04-20 13:19:53 +0000] [36] [INFO] Shutting down: Master
2021-04-20T13:19:53.264555292Z [2021-04-20 13:19:53 +0000] [36] [INFO] Reason: Worker failed to boot.
2021-04-20T13:20:38.490148437Z
2021-04-20T13:20:38.490188638Z _____
2021-04-20T13:20:38.490198738Z / _ \ __________ _________ ____
2021-04-20T13:20:38.490206138Z / /_\ ___ / | _ __ _/ __ \
2021-04-20T13:20:38.490213438Z / | / /| | /| | /\ /
2021-04-20T13:20:38.490220438Z _|__ /_____ ____/ || _ >
2021-04-20T13:20:38.490227839Z / / /
2021-04-20T13:20:38.490234939Z
2021-04-20T13:20:38.490241639Z A P P S E R V I C E O N L I N U X
2021-04-20T13:20:38.490248539Z
2021-04-20T13:20:38.490255039Z Documentation: http://aka.ms/webapp-linux
2021-04-20T13:20:38.490261839Z Python 3.8.6
2021-04-20T13:20:38.490268539Z Note: Any data outside '/home' is not persisted
2021-04-20T13:20:38.670465359Z Starting OpenBSD Secure Shell server: sshd.
2021-04-20T13:20:38.726919968Z App Command Line not configured, will attempt auto-detect
2021-04-20T13:20:38.727975087Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite
2021-04-20T13:20:38.741892035Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2021-04-20T13:20:38.750397087Z Build Operation ID: |VB6FjegnU2Y=.1767d6f_
2021-04-20T13:20:38.756871403Z Oryx Version: 0.2.20210225.2, Commit: f7b557f29a83aa078cc94c0056e7337c07f14271, ReleaseTagName: 20210225.2
2021-04-20T13:20:38.759283146Z Output is compressed. Extracting it...
2021-04-20T13:20:38.759420049Z Extracting '/home/site/wwwroot/output.tar.gz' to directory '/tmp/8d903fede05f842'...
2021-04-20T13:20:39.773593671Z App path is set to '/tmp/8d903fede05f842'
2021-04-20T13:20:40.936563052Z Detected an app based on Flask
2021-04-20T13:20:40.936623053Z Generating gunicorn
command for 'app:app'
2021-04-20T13:20:41.629288330Z Writing output script to '/opt/startup/startup.sh'
2021-04-20T13:20:42.537804019Z Using packages from virtual environment antenv located at /tmp/8d903fede05f842/antenv.
2021-04-20T13:20:42.540547668Z Updated PYTHONPATH to ':/tmp/8d903fede05f842/antenv/lib/python3.8/site-packages'
2021-04-20T13:20:43.547389986Z [2021-04-20 13:20:43 +0000] [36] [INFO] Starting gunicorn 20.0.4
2021-04-20T13:20:43.549601726Z [2021-04-20 13:20:43 +0000] [36] [INFO] Listening at: http://0.0.0.0:8000 (36)
2021-04-20T13:20:43.551214655Z [2021-04-20 13:20:43 +0000] [36] [INFO] Using worker: sync
2021-04-20T13:20:43.560266718Z [2021-04-20 13:20:43 +0000] [38] [INFO] Booting worker with pid: 38
2021-04-20T13:20:43.943742819Z [2021-04-20 13:20:43 +0000] [38] [ERROR] Exception in worker process
2021-04-20T13:20:43.943800720Z Traceback (most recent call last):
2021-04-20T13:20:43.943814020Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2021-04-20T13:20:43.943840920Z worker.init_process()
2021-04-20T13:20:43.943849320Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
2021-04-20T13:20:43.943857021Z self.load_wsgi()
2021-04-20T13:20:43.943864521Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2021-04-20T13:20:43.943872521Z self.wsgi = self.app.wsgi()
2021-04-20T13:20:43.943880021Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-04-20T13:20:43.943887621Z self.callable = self.load()
2021-04-20T13:20:43.943895021Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2021-04-20T13:20:43.943902621Z return self.load_wsgiapp()
2021-04-20T13:20:43.943909822Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2021-04-20T13:20:43.943917622Z return util.import_app(self.app_uri)
2021-04-20T13:20:43.943924922Z File "/opt/python/3.8.6/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
2021-04-20T13:20:43.943932622Z mod = importlib.import_module(module)
2021-04-20T13:20:43.943940022Z File "/opt/python/3.8.6/lib/python3.8/importlib/init.py", line 127, in import_module
2021-04-20T13:20:43.943947822Z return _bootstrap._gcd_import(name[level:], package, level)
2021-04-20T13:20:43.943955322Z File "", line 1014, in _gcd_import
2021-04-20T13:20:43.943963123Z File "", line 991, in _find_and_load
2021-04-20T13:20:43.979804667Z File "", line 975, in _find_and_load_unlocked
2021-04-20T13:20:43.979846668Z File "", line 671, in _load_unlocked
2021-04-20T13:20:43.979855968Z File "", line 783, in exec_module
2021-04-20T13:20:43.979863769Z File "", line 219, in _call_with_frames_removed
2021-04-20T13:20:43.979871469Z File "/tmp/8d903fede05f842/app.py", line 2, in
2021-04-20T13:20:43.979879269Z from PIL import Image, ImageDraw, ImageFont
2021-04-20T13:20:43.979886669Z ModuleNotFoundError: No module named 'PIL'
2021-04-20T13:20:43.979900069Z [2021-04-20 13:20:43 +0000] [38] [INFO] Worker exiting (pid: 38)
2021-04-20T13:20:44.040013951Z [2021-04-20 13:20:44 +0000] [36] [INFO] Shutting down: Master
2021-04-20T13:20:44.040600562Z [2021-04-20 13:20:44 +0000] [36] [INFO] Reason: Worker failed to boot.