-
Notifications
You must be signed in to change notification settings - Fork 344
Labels
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: MacOS 10.15.7
- Firebase SDK version:
V6.0.0
- Firebase Product:
app_check
- Python version: 3.7.9
- Pip version: 22.1.2
[REQUIRED] Step 3: Describe the problem
Updated to V6.0.0 and attempted to run my development server within Flask and encountered the following errors:
Error: While importing 'api', an ImportError was raised:
Traceback (most recent call last):
File "/Users/kdfriedman/Desktop/curate-ai-python-api/env/lib/python3.7/site-packages/flask/cli.py", line 218, in locate_app
__import__(module_name)
File "/Users/kdfriedman/Desktop/curate-ai-python-api/api/api.py", line 2, in <module>
from auth import validate_auth, validate_app
File "/Users/kdfriedman/Desktop/curate-ai-python-api/api/auth.py", line 2, in <module>
from service.firebase import verify_auth_token, verify_app_token
File "/Users/kdfriedman/Desktop/curate-ai-python-api/api/service/firebase.py", line 2, in <module>
from firebase_admin import credentials, auth, firestore, app_check
File "/Users/kdfriedman/Desktop/curate-ai-python-api/env/lib/python3.7/site-packages/firebase_admin/app_check.py", line 18, in <module>
import jwt
ModuleNotFoundError: No module named 'jwt'
After attempting to install the jwt package to fix the issue, a new error occurred:
Error: While importing 'api', an ImportError was raised:
Traceback (most recent call last):
File "/Users/kdfriedman/Desktop/curate-ai-python-api/env/lib/python3.7/site-packages/flask/cli.py", line 218, in locate_app
__import__(module_name)
File "/Users/kdfriedman/Desktop/curate-ai-python-api/api/api.py", line 2, in <module>
from auth import validate_auth, validate_app
File "/Users/kdfriedman/Desktop/curate-ai-python-api/api/auth.py", line 2, in <module>
from service.firebase import verify_auth_token, verify_app_token
File "/Users/kdfriedman/Desktop/curate-ai-python-api/api/service/firebase.py", line 2, in <module>
from firebase_admin import credentials, auth, firestore, app_check
File "/Users/kdfriedman/Desktop/curate-ai-python-api/env/lib/python3.7/site-packages/firebase_admin/app_check.py", line 19, in <module>
from jwt import PyJWKClient, ExpiredSignatureError, InvalidTokenError
ImportError: cannot import name 'PyJWKClient' from 'jwt' (/Users/kdfriedman/Desktop/curate-ai-python-api/env/lib/python3.7/site-packages/jwt/__init__.py)
Steps to reproduce:
I updated to V6 of the SDK and immediately encountered this issue. When I attempted to install the jwt package, a different error occurred.
Relevant Code:
import firebase_admin
from firebase_admin import credentials, auth, firestore, app_check
import os
# Initialize the default app
ENV_KEYS = {
"CREDS_GO_HERE"
}
CREDENTIALS = credentials.Certificate(ENV_KEYS)
firebase_app = firebase_admin.initialize_app(CREDENTIALS)
verify_app_token = app_check.verify_token
Activity
google-oss-bot commentedon Oct 13, 2022
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
lahirumaramba commentedon Oct 14, 2022
Hey @kdfriedman, Thank you for reporting this issue!
I think we need to add the new dependency to
setup.py
to include it in the final artifacts. I will submit a fix for this.In the meantime, could you check installing the dependency
pyjwt
in your project would fix this issue?Thanks!
kdfriedman commentedon Oct 14, 2022
Thanks for the update! Yea, installing that particular package fixed my issue. Thanks again