0

I am trying to upload my python server functions using firebase deploy

When I run this command I get the following error:

Error: Failed to find location of Firebase Functions SDK. Did you forget to run '. "/src/routes/functions/venv/bin/activate" && python3.11 -m pip install -r requirements.txt'?

I tried to create a virtual environment by running: python3 -m venv venv

I then activated the virtual environment by running: source venv/bin/activate

I then installed the firebase functions in my requirements.txt file by running: pip3 install -r requirements.txt

In the requirements.txt file is the following: firebase_functions~=0.1.0

Here is a list of all my pip libraries:

Package                  Version
------------------------ ---------
blinker                  1.9.0
CacheControl             0.14.1
cachetools               5.5.0
certifi                  2024.8.30
cffi                     1.17.1
charset-normalizer       3.4.0
click                    8.1.7
cloudevents              1.9.0
cryptography             43.0.3
deprecation              2.1.0
firebase-admin           6.6.0
firebase-functions       0.1.2
Flask                    3.1.0
Flask-Cors               5.0.0
functions-framework      3.8.1
google-api-core          2.23.0
google-api-python-client 2.153.0
google-auth              2.36.0
google-auth-httplib2     0.2.0
google-cloud-core        2.4.1
google-cloud-firestore   2.19.0
google-cloud-storage     2.18.2
google-crc32c            1.6.0
google-events            0.13.0
google-resumable-media   2.7.2
googleapis-common-protos 1.66.0
grpcio                   1.67.1
grpcio-status            1.67.1
gunicorn                 23.0.0
httplib2                 0.22.0
idna                     3.10
itsdangerous             2.2.0
Jinja2                   3.1.4
MarkupSafe               3.0.2
msgpack                  1.1.0
packaging                24.2
pip                      24.2
proto-plus               1.25.0
protobuf                 5.28.3
pyasn1                   0.6.1
pyasn1_modules           0.4.1
pycparser                2.22
PyJWT                    2.9.0
pyparsing                3.2.0
PyYAML                   6.0.2
requests                 2.32.3
rsa                      4.9
typing_extensions        4.12.2
uritemplate              4.1.1
urllib3                  2.2.3
watchdog                 6.0.0
Werkzeug                 3.1.3

Any help would be appreciated.

1 Answer 1

1

I ran into this problem a few months ago and came across this issue, which reminded me that you have to create the venv inside the functions folder. I was creating the venv at the root of my project, and so even though I was able to activate it and install the deps, firebase does not see any of them when you try and deploy.

1
  • Thanks for the link. I ended up downgrading from python 3.12 to python 3.11 and firebase deploy now works for me.
    – MattJ
    Commented Nov 14, 2024 at 1:17

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.