Jason O.
Jason O.

Reputation: 3290

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.

Upvotes: 7

Views: 3162

Answers (4)

M.Idrish
M.Idrish

Reputation: 437

because of you are using python 3.7 version and using system variable as a local variable try this and thanks me later....

1)rename .async into .async_

2)open__init__ file and change .async into .async_

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

because of .async is the keyword now

I hope it helps you

Upvotes: 1

b4oshany
b4oshany

Reputation: 712

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.

Upvotes: 4

Adam
Adam

Reputation: 5985

There is now a python-firebase-gae project which is based on URL Fetch and does not depend on any restricted packages.

Upvotes: 2

Rob
Rob

Reputation: 2839

The python-firebase pip package depends on the "requests" pip package which isn't available in GAE python. There's only urlfetch available (docs https://cloud.google.com/appengine/docs/python/urlfetch/).

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

Upvotes: 0

Related Questions