Skip to content

Can this run on Google App Engine? #18

Closed

Description

@micahbolen

I'm getting this error:

File "/Users/micahbolen/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 84, in LoadObject
obj = __import__(path[0])
  File "/Users/micahbolen/Desktop/institutions-search/helloworld.py", line 4, in <module>
from firebase import firebase
  File "/Users/micahbolen/Desktop/institutions-search/gaenv_lib/firebase/__init__.py", line 3, in <module>
from .async import process_pool
  File "/Users/micahbolen/Desktop/institutions-search/gaenv_lib/firebase/async.py", line 1, in <module>
import multiprocessing
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 65, in <module>
from multiprocessing.util import SUBDEBUG, SUBWARNING
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/util.py", line 40, in <module>
from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags

Activity

  1. hofline commented on Dec 1, 2014

    @hofline

    hello, is any workaround for this. I got the same issue downloading and building code from master branch. Thanks.

  2. micahbolen commented on Jan 14, 2015

    @micahbolen
    Author

    Reopening this issue on behalf of @hofline

  3. juliankmazo commented on Mar 10, 2015

    @juliankmazo

    Hello. Any workaround?

  4. matrixl commented on Jul 23, 2015

    @matrixl

    Has anybody had a solution for this?

  5. nckh commented on Jul 24, 2015

    @nckh

    Hi. I ended up using Requests and call the Firebase HTTP API manually!

  6. micahbolen commented on Jul 24, 2015

    @micahbolen
    Author

    @nckh Kudos for figuring out a workaround.

  7. kevando commented on Oct 27, 2016

    @kevando

    Hey @b4oshany I tried using your fork and I am still getting this error. Any idea what I'm doing wrong?

    ImportError: cannot import name _args_from_interpreter_flags

  8. b4oshany commented on Oct 27, 2016

    @b4oshany
    Collaborator

    @kevando, appengine blocks the use of multiprocessing or any form of threading that is not called by the deferred and the task queue package. The python-firebase-gae package doesn't use multiprocessing, instead it uses the deferred package to perform multiple subroutine.

    pip install python-firebase-gae
    
  9. kevando commented on Oct 27, 2016

    @kevando

    Wow. @b4oshany I don't know what you said to help me understand, but I finally got it working! Thanks so much. Appengine is a tricky one.

    One last question. Is it possible to create some sort of listener with a python appengine server? I want my python server to execute a function everytime there is a specific change to the firebase data (similar to how I would in node). Or would it make more sense to just set up a cron that queues firebase every minute or so.

  10. bogdanr commented on Nov 9, 2016

    @bogdanr

    Yeah, python-firebase-gae should be merged somehow to import either lib depending on the environment. Perhaps something like this in async.py could be a staring point:

    if os.environ.get('SERVER_SOFTWARE'):
        if os.environ.get('SERVER_SOFTWARE').startswith('Development') or os.environ.get('SERVER_SOFTWARE').startswith('Google'):
            from google.appengine.ext import deferred
        else:
            import multiprocessing
  11. b4oshany commented on Nov 9, 2016

    @b4oshany
    Collaborator

    @bogdanr I had to change the async function and other functions that are within the python-firebase package to support app engine deferred module. Hence, the reason why I created a separate package instead.

  12. b4oshany commented on Nov 9, 2016

    @b4oshany
    Collaborator

    @kevando It is possible to do so, but setting up a task queue (Cron Job) is easier and more convenient.

  13. CarMoreno commented on Oct 22, 2020

    @CarMoreno

    Hi @b4oshany it's amazing you have done. Right now my gae has a instance of Python 2.7. Your branch would work on Python 2.7???

  14. b4oshany commented on Oct 23, 2020

    @b4oshany
    Collaborator

    Hi @CarMoreno, I haven't tested it, but the python-firebase-gae package should be working on 2.7. It was coded in py 2.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions