thisbejim / Pyrebase

A simple python wrapper for the Firebase API.
2.05k stars 525 forks source link

Pyrebase Google Cloud Run (Docker) - Build Error #380

Open echtme opened 3 years ago

echtme commented 3 years ago

I use Google Cloud Run with Python-3.8-slim with Flask, to deploy my projects online. But as soon as I add pyrebase to the requirement.txt and try to build the docker/push to the cloud, I get the error below (pycrypto).

Building wheel for pycrypto (setup.py): started Building wheel for pycrypto (setup.py): finished with status 'error' ERROR: Command errored out with exit status 1: command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-76ri08fs/pycrypto_1a11af1ab48b403ba33d2c882a097f8d/setup.py'"'"'; file='"'"'/tmp/pip-install-76ri08fs/pycrypto_1a11af1ab48b403ba33d2c882a097f8d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-fuukd50v cwd: /tmp/pip-install-76ri08fs/pycrypto_1a11af1ab48b403ba33d2c882a097f8d/ Complete output (187 lines):

echtme commented 3 years ago

I found the problem, I've python-slim which was causing the issue!

Biaggio74 commented 2 years ago

@echtme so you say it is not possible to add pyrebase to python:3.8-slim ? Which image would you suggest to run Flask with Pyrebase?

echtme commented 2 years ago

It's been a while since I had this problem. But as I remember, I switched to the firebase-admin package from google, as I couldn't get pyrebase running on my setup.

Biaggio74 commented 2 years ago

@echtme thanks for your prompt reply ;) ...actually in the meantime I did the same. However there are some tasks which we cannot do with the firebase_admin SDK, that is to sign in Firebase users. But I overcome the issue by utilising the Firebase Admin SDK REST service, so I could manage user auth without Pyrebase.

echtme commented 2 years ago

I just had a look at my old code and I did exactly the same at end ;)