title: ModuleNotFoundError in custom module on azure webapps
body: <p>I'm trying to run an app.py made with python3.7(flask) in azure webapps.<br><br>
  I deployed app.py and sleep_model.py that app.py uses from github.<br>
  (app.py imports sleep_model.py, and sleep_model.py imports numpy.)<br>
   <br> 
  Then I got this error on azure log stream:<br>
  '''  </p>
  
  <pre><code>2020-04-28T10:55:13.536802053Z   File "/home/site/wwwroot/app.py", line 15, in &lt;module&gt;  
  2020-04-28T10:55:13.536806954Z    　 import sleep_model  
  2020-04-28T10:55:13.536811454Z   File "/home/site/wwwroot/sleep_model.py", line 1, in &lt;module&gt;  
  2020-04-28T10:55:13.536816354Z    　 import numpy as np  
  2020-04-28T10:55:13.536821154Z ModuleNotFoundError: No module named 'numpy'  
  </code></pre>
  
  <p>'''</p>
  
  <p>What should I modify for sleep_model.py to successfully import numpy?
  <br><br><br>
  The structure of my resources:<br>
  Subscription - Resource Group - App Service<br>
  Free (F1)    - sleepapitest2  - sleepapitest2<br>
  <br><br><br>
  App Service Plan: appsvc_linux_centralus (F1: Free)
  <br><br><br>
  System Info:<br>
  OS version: Unix 4.4.0.128<br>
  64 bit system: True<br>
  64 bit process: True<br>
  Processor count: 1<br>
  <br><br><br>
  The structure of my wwwroot is this:</p>
  
  <p>'''</p>
  
  <pre><code>img  
  pythonenv3.8  
  tests  
  __pycache__  
  app.py  
  ConceptofFunctionEvaluate.md  
  oryx-manifest.toml  
  README.md  
  requirements.txt  
  sleep_model.py  
  </code></pre>
  
  <p>'''</p>
  
  <p><br><br><br>
  The codes inside app.py is this:  </p>
  
  <p>app.py<br>
  '''  </p>
  
  <pre><code>from flask import abort, Flask, jsonify, request  
  from werkzeug.exceptions import BadRequest  
  from logging import getLogger, StreamHandler, FileHandler, DEBUG, Formatter  
  import sleep_model
  
  (application codes)
  
  if __name__ == "__main__":
      app.run(debug=True)
  </code></pre>
  
  <p>'''</p>
  
  <p><br><br><br>
  The importing part of sleep_model.py is this:</p>
  
  <p>sleep:model.py<br>
  '''  </p>
  
  <pre><code>import numpy as np   
  </code></pre>
  
  <p>'''
  <br><br><br>
  The inside of requirements.txt file is this:  </p>
  
  <p>requirements.text<br>
  '''  </p>
  
  <pre><code>flask  
  numpy  
  logging  
  werkzeug  
  </code></pre>
  
  <p>'''<br>
  <br><br><br>
  In the GitHub Action logs, it appears that numpy is installed successfuly.</p>
  
  <p>GitHub Actions > build-and-deploy > Build using AppService-Buld<br>
  '''    </p>
  
  <pre><code>Run azure/appservice-build@v1
    with:
      platform: python
    env:
      pythonLocation: /opt/hostedtoolcache/Python/3.7.6/x64
  /usr/bin/docker run --name c27d3147d163fea80a45388665e71d8a738aa0_a89863 --label c27d31 --workdir /github/workspace --rm -e pythonLocation -e INPUT_PLATFORM -e INPUT_SOURCE-DIRECTORY -e INPUT_PLATFORM-VERSION -e INPUT_OUTPUT-DIRECTORY -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/sleep_apnea_api/sleep_apnea_api":"/github/workspace" c27d31:47d163fea80a45388665e71d8a738aa0  "" "python" "" ""
  
  No source directory was provided -- the root of the repository ('GITHUB_WORKSPACE' environment variable) will be built: '/github/workspace'
  No output directory was provided
  Platform provided: 'python'
  No platform version provided -- Oryx will determine the version.
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  100   139  100   139    0     0   1564      0 --:--:-- --:--:-- --:--:--  1579
  
  Running command 'oryx build /github/workspace --platform python --enable-dynamic-install'
  Build orchestrated by Microsoft Oryx, https://github.com/Microsoft/Oryx
  You can report issues at https://github.com/Microsoft/Oryx/issues
  
  Oryx Version      : 0.2.20200312.2, Commit: d1cf6b4a89345b6a7d0dc25d0fbd67860862ee18, ReleaseTagName: 20200312.2
  Build Operation ID: |NIcJoHTZQ4M=.3e27c1c4_
  Repository Commit : a0f0cc373a543d1d26feb535d6ef12479abf0ff9
  
  
  Source directory     : /github/workspace
  Destination directory: /github/workspace
  Python Version: /opt/python/3.8.2/bin/python3
  Python Virtual Environment: pythonenv3.8
  Creating virtual environment ...
  Activating virtual environment ...
  
  Upgrading pip...
  WARNING: The directory '/github/home/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  WARNING: The directory '/github/home/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
  Collecting pip
    Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
  Installing collected packages: pip
    Found existing installation: pip 19.2.3
      Uninstalling pip-19.2.3:
        Successfully uninstalled pip-19.2.3
  Successfully installed pip-20.0.2
  Done in 2 sec(s).
  Running pip install...
  [10:50:41+0000] Collecting flask
  [10:50:41+0000]   Downloading Flask-1.1.2-py2.py3-none-any.whl (94 kB)
  [10:50:41+0000] Collecting numpy
  [10:50:41+0000]   Downloading numpy-1.18.3-cp38-cp38-manylinux1_x86_64.whl (20.6 MB)
  [10:50:42+0000] Collecting werkzeug
  [10:50:42+0000]   Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
  [10:50:42+0000] Collecting Jinja2&gt;=2.10.1
  [10:50:43+0000]   Downloading Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
  [10:50:43+0000] Collecting click&gt;=5.1
  [10:50:43+0000]   Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
  [10:50:43+0000] Collecting itsdangerous&gt;=0.24
  [10:50:43+0000]   Downloading itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
  [10:50:43+0000] Collecting MarkupSafe&gt;=0.23
  [10:50:43+0000]   Downloading MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl (32 kB)
  [10:50:43+0000] Installing collected packages: MarkupSafe, Jinja2, werkzeug, click, itsdangerous, flask, numpy
  [10:50:46+0000] Successfully installed Jinja2-2.11.2 MarkupSafe-1.1.1 click-7.1.2 flask-1.1.2 itsdangerous-1.1.0 numpy-1.18.3 werkzeug-1.0.1
  Done running pip install.
  
  Removing existing manifest file
  Creating a manifest file...
  Manifest file created.
  
  Done in 11 sec(s).
  </code></pre>
  
  <p>'''</p>
  
  <p><br><br><br>
  But log streams in azure, 'ModuleNotFoundError' occures:<br>
  log stream
  '''  </p>
  
  <pre><code>2020-04-28T10:55:11.375437745Z Updated PYTHONPATH to ':/home/site/wwwroot/pythonenv3.8/lib/python3.7/site-packages'  
  2020-04-28T10:55:12.774642858Z [2020-04-28 10:55:12 +0000] [38] [INFO] Starting gunicorn 20.0.4  
  2020-04-28T10:55:12.775951599Z [2020-04-28 10:55:12 +0000] [38] [INFO] Listening at: http://0.0.0.0:8000 (38)  
  2020-04-28T10:55:12.776515817Z [2020-04-28 10:55:12 +0000] [38] [INFO] Using worker: sync  
  2020-04-28T10:55:12.804942720Z [2020-04-28 10:55:12 +0000] [41] [INFO] Booting worker with pid: 41  
  2020-04-28T10:55:13.536643548Z [2020-04-28 10:55:13 +0000] [41] [ERROR] Exception in worker process  
  2020-04-28T10:55:13.536680450Z Traceback (most recent call last):  
  2020-04-28T10:55:13.536687550Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker  
  2020-04-28T10:55:13.536693050Z     worker.init_process()  
  2020-04-28T10:55:13.536697650Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process  
  2020-04-28T10:55:13.536709650Z     self.load_wsgi()  
  2020-04-28T10:55:13.536714651Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi  
  2020-04-28T10:55:13.536719551Z     self.wsgi = self.app.wsgi()  
  2020-04-28T10:55:13.536724251Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi  
  2020-04-28T10:55:13.536729151Z     self.callable = self.load()  
  2020-04-28T10:55:13.536734151Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load  
  2020-04-28T10:55:13.536739151Z     return self.load_wsgiapp()  
  2020-04-28T10:55:13.536743652Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp  
  2020-04-28T10:55:13.536748552Z     return util.import_app(self.app_uri)  
  2020-04-28T10:55:13.536753252Z   File "/opt/python/3.7.5/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app  
  2020-04-28T10:55:13.536758252Z     mod = importlib.import_module(module)  
  2020-04-28T10:55:13.536762952Z   File "/opt/python/3.7.5/lib/python3.7/importlib/__init__.py", line 127, in import_module  
  2020-04-28T10:55:13.536767752Z     return _bootstrap._gcd_import(name[level:], package, level)  
  2020-04-28T10:55:13.536772452Z   File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import  
  2020-04-28T10:55:13.536777653Z   File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load  
  2020-04-28T10:55:13.536782553Z   File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked  
  2020-04-28T10:55:13.536787353Z   File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked  
  2020-04-28T10:55:13.536792153Z   File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module  
  2020-04-28T10:55:13.536797153Z   File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed  
  2020-04-28T10:55:13.536802053Z   File "/home/site/wwwroot/app.py", line 15, in &lt;module&gt;  
  2020-04-28T10:55:13.536806954Z     import sleep_model  
  2020-04-28T10:55:13.536811454Z   File "/home/site/wwwroot/sleep_model.py", line 1, in &lt;module&gt;  
  2020-04-28T10:55:13.536816354Z     import numpy as np  
  2020-04-28T10:55:13.536821154Z ModuleNotFoundError: No module named 'numpy'  
  2020-04-28T10:55:13.541040988Z [2020-04-28 10:55:13 +0000] [41] [INFO] Worker exiting (pid: 41)  
  2020-04-28T10:55:13.640991661Z [2020-04-28 10:55:13 +0000] [38] [INFO] Shutting down: Master  
  2020-04-28T10:55:13.649049717Z [2020-04-28 10:55:13 +0000] [38] [INFO] Reason: Worker failed to boot.  
  2020-04-28 10:55:14.734 ERROR - Container sleepapitest2_0_c4c43b35 for site sleepapitest2 has exited, failing site start  
  2020-04-28 10:55:14.736 ERROR - Container sleepapitest2_0_c4c43b35 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.  
  2020-04-28 10:55:14.784 INFO  - Stoping site sleepapitest2 because it failed during startup.  
  </code></pre>
  
  <p>'''  </p>
  
  <p><br>
  Thenk you for your concern.</p>