title: import tensorflow in Flask caused it hang
body: <p>After following this tutorial <a href="https://www.codementor.io/@jqn/deploy-a-flask-app-on-aws-ec2-13hp1ilqy2" rel="nofollow noreferrer">link</a>, and having <code>flaskapp.py</code> below</p>
  <pre><code>from flask import Flask
  import tensorflow
  app = Flask(__name__)
  @app.route('/')
  def hello_world():
    return 'Hello from Flask'
  if __name__ == '__main__':
    app.run()
  </code></pre>
  <ol>
  <li>Without <code>import tensorflow</code> line, the Flask app would return <code>Hello from Flask</code> - expected behaviour.</li>
  <li>As soon as I added <code>import tensorflow</code>, and restart apache, the browser would hang (I don't see any log in Apache <code>error.log</code> file).</li>
  </ol>
  <p>Btw, I have installed tensorflow using <code>sudo pip3 install tensorflow</code>. If I replaced <code>tensorflow</code> with another library like <code>pandas</code> it works well.</p>
  <p>Something specific with <code>tensorflow</code> kills the Flask app.</p>
  <p>Below is the result if I run directly using <code>python3</code> command</p>
  <pre><code>python3 flaskapp.py 
  2021-01-07 18:58:22.352532: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
  2021-01-07 18:58:22.352579: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
   * Serving Flask app &quot;flaskapp&quot; (lazy loading)
   * Environment: production
     WARNING: This is a development server. Do not use it in a production deployment.
     Use a production WSGI server instead.
   * Debug mode: off
   * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
  </code></pre>
  <p>Kindly suggest, thanks a lot in advance!</p>