title: ImportError: cannot import name 'Markup' from 'jinja2'
body: <p>When I recently deployed my project that includes <code>Flask==1.0.2</code> and <code>Jinja2&gt;=2.10.1</code>, I got the following error. It was running fine when I deployed it the previous day. I tried updating <code>Jinja2</code> but that didn't fix the issue.</p>
  <pre><code>  File &quot;/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py&quot;, line 146, in load_wsgi
      self.wsgi = self.app.wsgi()
    File &quot;/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py&quot;, line 67, in wsgi
      self.callable = self.load()
    File &quot;/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py&quot;, line 58, in load
      return self.load_wsgiapp()
    File &quot;/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py&quot;, line 48, in load_wsgiapp
      return util.import_app(self.app_uri)
    File &quot;/usr/local/lib/python3.7/site-packages/gunicorn/util.py&quot;, line 359, in import_app
      mod = importlib.import_module(module)
    File &quot;/usr/local/lib/python3.7/importlib/__init__.py&quot;, line 127, in import_module
      return _bootstrap._gcd_import(name[level:], package, level)
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 983, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 953, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1006, in _gcd_import
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 983, in _find_and_load
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 967, in _find_and_load_unlocked
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 677, in _load_unlocked
    File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 728, in exec_module
    File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
    File &quot;/app/search_service/__init__.py&quot;, line 12, in &lt;module&gt;
      from flasgger import Swagger
    File &quot;/usr/local/lib/python3.7/site-packages/flasgger/__init__.py&quot;, line 10, in &lt;module&gt;
      from .base import Swagger, Flasgger, NO_SANITIZER, BR_SANITIZER, MK_SANITIZER, LazyJSONEncoder  # noqa
    File &quot;/usr/local/lib/python3.7/site-packages/flasgger/base.py&quot;, line 19, in &lt;module&gt;
      from flask import Blueprint
    File &quot;/usr/local/lib/python3.7/site-packages/flask/__init__.py&quot;, line 19, in &lt;module&gt;
      from jinja2 import Markup, escape
  ImportError: cannot import name 'Markup' from 'jinja2' (/usr/local/lib/python3.7/site-packages/jinja2/__init__.py)
  </code></pre>
  <p><code>requirements.txt</code>:</p>
  <pre><code>attrs&gt;=19.1.0
  boto3==1.17.23
  click==7.0
  itsdangerous==2.0.1
  flasgger==0.9.5
  Flask==1.0.2
  Flask-RESTful&gt;=0.3.6
  flask-cors==3.0.8
  gunicorn==20.1.0
  Jinja2&gt;=2.10.1
  jsonschema&gt;=3.0.1,&lt;4.0
  marshmallow&gt;=3.0,&lt;=3.6
  marshmallow3-annotations&gt;=1.0.0
  pytz==2021.1
  requests&gt;=2.25.0
  requests-aws4auth==1.1.0
  statsd==3.2.1
  typing==3.6.4
  werkzeug&gt;=2.0.0
  wheel==0.36.2
  itsdangerous==2.0.1
  </code></pre>