You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue while trying to use the logger submodule from the firebase_functions module. According to the documentation and examples, it seems like there should be a logger submodule available, but it doesn't exist in the installed package.
Steps to Reproduce:
Install firebase_functions using pip.
Attempt to import the logger submodule as shown below:
fromfirebase_functionsimportlogger
Run the script.
Expected Behavior:
The logger submodule should be imported without any errors.
Actual Behavior:
The following error is raised: ImportError: cannot import name 'logger' from 'firebase_functions' (/path/to/venv/lib/python3.12/site-packages/firebase_functions/init.py)
The text was updated successfully, but these errors were encountered:
Check that you have the latest version of firebase-functions installed. I had the same issue and checked pip to see that I was on version 0.1.2 for some reason when setting up firebase functions as explained in their docs.
If you are using a venv inside your firebase functions folder, you can simply activate the environment using
venv\Scripts\activate
on Windows. The Path for Linux should be slightly different but similar. After activting the venv, you can use
pip list
to show the currently installed packages with their version and
pip install --upgrade firebase-functions
to install the latest version which should contain the logging module.
The only question left is why Firebase installs such an old version of firebase-functions when running the firebase init functions command to create a python functions directory.
Which sample?
functions-samples/Python/quickstarts/monitor-cloud-logging/functions/main.py
Line 8 in 703c035
What is the issue with this sample's docs?
Description:
I encountered an issue while trying to use the
logger
submodule from thefirebase_functions
module. According to the documentation and examples, it seems like there should be alogger
submodule available, but it doesn't exist in the installed package.Steps to Reproduce:
Install
firebase_functions
using pip.Attempt to import the
logger
submodule as shown below:Run the script.
Expected Behavior:
The
logger
submodule should be imported without any errors.Actual Behavior:
The following error is raised:
ImportError: cannot import name 'logger' from 'firebase_functions' (/path/to/venv/lib/python3.12/site-packages/firebase_functions/init.py)
The text was updated successfully, but these errors were encountered: