title: Google Cloud Functions - ImportError: cannot import name 'InvalidKeyError' from 'jwt.exceptions'
body: <p>I am getting the below error in GCP while executing Cloud Functions i.e. Cloud PubSub with Python 3.8, also below is the packages included in the requirements.txt</p>
  <p>I have also tried only with jwt installed, but got the same error. tried only with pyjwt, again got the same error. Tried with both, again same error.</p>
  <p><strong>Requirements.txt:</strong></p>
  <ul>
  <li>atlassian-python-api==3.13.0</li>
  <li>google==3.0.0</li>
  <li>google-api-python-client==2.18.0</li>
  <li>google-auth==2.0.1</li>
  <li>google-auth-httplib2==0.1.0</li>
  <li>google-auth-oauthlib==0.4.5</li>
  <li>oauth2client==4.1.3</li>
  <li>oauthlib==3.1.1</li>
  <li>sendgrid==6.8.1</li>
  <li>gspread==4.0.1</li>
  <li>pandas==1.3.2</li>
  <li>jwt==1.2.0</li>
  <li>PyJWT==2.1.0</li>
  <li>cryptography==3.4.8</li>
  <li>rsa==4.7.2</li>
  </ul>
  <p><strong>Traceback:</strong></p>
  <pre><code>Traceback (most recent call last):
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py&quot;, line 2447, in wsgi_app
      response = self.full_dispatch_request()
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py&quot;, line 1952, in full_dispatch_request
      rv = self.handle_user_exception(e)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py&quot;, line 1821, in handle_user_exception
      reraise(exc_type, exc_value, tb)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/_compat.py&quot;, line 39, in reraise
      raise value
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py&quot;, line 1950, in full_dispatch_request
      rv = self.dispatch_request()
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/flask/app.py&quot;, line 1936, in dispatch_request
      return self.view_functions[rule.endpoint](**req.view_args)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/functions_framework/__init__.py&quot;, line 152, in view_func
      function(data, context)
    File &quot;/workspace/main.py&quot;, line 72, in get_data_from_jira
      data = jira_instance.jql(&quot;project = PROJECTNAME AND issuetype = 'ISSUETYPE' AND status = 'In Progress'&quot;)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/atlassian/jira.py&quot;, line 2418, in jql
      return self.get(url, params=params)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/atlassian/rest_client.py&quot;, line 264, in get
      response = self.request(
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/atlassian/rest_client.py&quot;, line 218, in request
      response = self._session.request(
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/requests/sessions.py&quot;, line 528, in request
      prep = self.prepare_request(req)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/requests/sessions.py&quot;, line 456, in prepare_request
      p.prepare(
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/requests/models.py&quot;, line 320, in prepare
      self.prepare_auth(auth, url)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/requests/models.py&quot;, line 556, in prepare_auth
      r = auth(self)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/requests_oauthlib/oauth1_auth.py&quot;, line 108, in __call__
      r.url, headers, _ = self.client.sign(
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/__init__.py&quot;, line 351, in sign
      ('oauth_signature', self.get_oauth_signature(request)))
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/__init__.py&quot;, line 186, in get_oauth_signature
      sig = self.SIGNATURE_METHODS[self.signature_method](base_string, self)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/signature.py&quot;, line 742, in sign_rsa_sha1_with_client
      return _sign_rsa('SHA-1', sig_base_str, client.rsa_key)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/signature.py&quot;, line 617, in _sign_rsa
      alg = _get_jwt_rsa_algorithm(hash_algorithm_name)
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/signature.py&quot;, line 562, in _get_jwt_rsa_algorithm
      import jwt.algorithms as jwt_algorithms
    File &quot;/layers/google.python.pip/pip/lib/python3.8/site-packages/jwt/algorithms.py&quot;, line 5, in &lt;module&gt;
      from .exceptions import InvalidKeyError
  ImportError: cannot import name 'InvalidKeyError' from 'jwt.exceptions' (/layers/google.python.pip/pip/lib/python3.8/site-packages/jwt/exceptions.py)
  </code></pre>