Firebase init functions and emulators:start - missing python3.12 installing dependencies

427 views
Skip to first unread message

Pat Ng

unread,
May 14, 2024, 7:03:29 PM5/14/24
to Firebase Google Group
Background - new to Firebase write and deploy python cloud function following steps in

Encountered the following (running in GCP Cloud Shell Python 3.10.12):
  • Step 3 initialize project - 1) after 1st firebase init functions, use  python3 -m venv venv  to create venv (complete the required folder structure), 2) run 2nd firebase init functions, note 

    Successfully installed pip-24.0
    /bin/sh: line 1: python3.12: command not found

  • Step 7 emulate execution -  get this

     functions: Failed to load function definition from source: FirebaseError: Failed to find location of Firebase Functions SDK. Did you forget to run '. "/home/pat/firebase/test_run/functions/venv/bin/activate" && python3.12 -m pip install -r requirements.txt'?

Q: something within "firebase init function" script?

Much appreciated on clarification / workaround suggestions.


Pascal Crausaz

unread,
Feb 18, 2025, 5:52:27 PMFeb 18
to Firebase Google Group
FWIIW, I had the same problem when I was running python 3.9 then later python 3.13. Looking at the logs, it seems that version 3.12 is specifically looked at during the deployment of the function (emulator & on gcp). Installing python3.12 resolved my issue.

Pat Ng

unread,
Feb 19, 2025, 7:08:08 AMFeb 19
to Firebase Google Group
Thx for the reply and clarification on python 3.12.

Workaround - instead of testing locally, do it all on Cloud Shell, i.e., Run the Cloud Run Emulator, and Deploy to Cloud Run.

Note - be sure to edit the .vscode/launch.json to point to the Dockerfile for the project.
Reply all
Reply to author
Forward
0 new messages