Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to Firebase from Python Google App Engine

I'm trying to connect to Firebase from App Engine, but I'm getting this error while trying to import Firebase using the Python-Firebase wrapper:

File "C:\_dev\PycharmProjects\myapp\project\project_handler.py", line 31, in <module>
from firebase import firebase
File "C:\_dev\PycharmProjects\myapp\external\firebase\__init__.py", line 3, in <module>
from .async import process_pool
File "C:\_dev\PycharmProjects\myapp\external\firebase\async.py", line 1, in <module>
import multiprocessing
File "C:\PYTHON27\lib\multiprocessing\__init__.py", line 65, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
File "C:\PYTHON27\lib\multiprocessing\util.py", line 40, in <module>
from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags

Other people seem to have the same issue, but I couldn't find the answer anywhere.

like image 494
Jason O. Avatar asked May 20 '15 04:05

Jason O.


People also ask

Can you use Firebase with python?

Overview. Firebase provides the tools and infrastructure you need to develop apps, grow your user base, and earn money. The Firebase Admin Python SDK enables access to Firebase services from privileged environments (such as servers or cloud) in Python.

How do I connect firestore to python?

To connect to Firestore, Firebase first performs authentication. To get the credentials for authentication, click on project settings, and click on “service accounts“. In the “Service accounts” tab, you can find a code snippet for connecting to Google Firebase. Select python as the language and copy the code snippet.

Does Firebase use App Engine?

The Firebase SDKs for Cloud Storage use the App Engine default bucket, which means that if you build an App Engine app, you can use the built-in App Engine APIs to share data between Firebase and App Engine.


1 Answers

The python firebase by default uses the multiprocessing package for threading. By default, AppEngine blocks all multiprocessing calls. AppEngine does its own form of multiprocessing by creating task queues and spinning up other instances of your application upon load.

I've created a python-firebase-gae package to deal with this issue.

like image 94
b4oshany Avatar answered Oct 02 '22 15:10

b4oshany