title: How do I run apt-get on an Azure web app or import cv2 in flask on azure?
body: <p>I am trying to import cv2 in a Flask webapp and I get the following message.</p>
  
  <pre><code>...
  2019-08-16T11:48:08.491189686Z     return util.import_app(self.app_uri)
  2019-08-16T11:48:08.491192986Z   File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
  2019-08-16T11:48:08.491196286Z     __import__(module)
  2019-08-16T11:48:08.491199486Z   File "/home/site/wwwroot/Webapp/main.py", line 12, in 
  2019-08-16T11:48:08.491203086Z     import cv2
  2019-08-16T11:48:08.491206386Z   File "/home/site/wwwroot/antenv3.6/lib/python3.6/site-packages/cv2/__init__.py", line 3, in 
  2019-08-16T11:48:08.491209886Z     from .cv2 import *
  2019-08-16T11:48:08.491213086Z ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
  2019-08-16T11:48:08.497759820Z [2019-08-16 11:48:08 +0000] [36] [INFO] Worker exiting (pid: 36)
  2019-08-16T11:48:08.652109211Z [2019-08-16 11:48:08 +0000] [33] [INFO] Shutting down: Master
  2019-08-16T11:48:08.652493413Z [2019-08-16 11:48:08 +0000] [33] [INFO] Reason: Worker failed to boot.
  </code></pre>
  
  <p>To solve i try running apt-get install libgtk2.0-dev at <a href="https://rvvoting.scm.azurewebsites.net/DebugConsole" rel="nofollow noreferrer">https://rvvoting.scm.azurewebsites.net/DebugConsole</a> but i get this error</p>
  
  <pre><code>E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
  E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
  
  /home&gt; 
  </code></pre>
  
  <p>I also tried running the apt-get command on web SSH, but it closes automatically just as i open it</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>I comment import cv2 from my code, connect to SSH and then run apt-get update then apt-get install libgtk2.0-dev.
  then i type import cv2 in python on the ssh and it works.
  so i again deploy the webapp by uncommenting import cv2 and the same error is back.</p>