Connect to Firebase from Python Google App Engine

I try to connect to Firebase from App Engine, but I get this error when trying to import Firebase using the Python-Firebase shell:

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 problem , but I could not find the answer anywhere.

+7
python google-app-engine firebase
source share
4 answers

By default, firebase python uses the multiprocessing package for streaming. By default, AppEngine blocks all multiprocessor calls. AppEngine performs its own multiprocessing procedure, creating task queues and deploying other instances of the application at boot time.

I created a python-firebase-gae package to solve this problem.

+4
source share

Now there is a python-firebase-gae project that is based on URL Fetch and is not dependent on any limited packages.

+2
source share

The python-firebase pip package depends on the "pip package" request , which is not available in python GAE. Only urlfetch is available there (docs https://cloud.google.com/appengine/docs/python/urlfetch/ ).

So, you can implement your own Python code to send requests directly to the firebase REST api using urlfetch ... or to make it reusable, you or someone can have a python-firebase version that uses urlfetch instead of library requests .

0
source share

because you are using Python version 3.7 and using the system variable as a local variable, try this and thank me later ....

1) rename .async to .async_

2) open__init__ file and change .async to .async_

3) open firebase.py and change .async to .async_

because of .async is now a keyword

I hope this helps you

0
source share

All Articles