python-firebase icon indicating copy to clipboard operation
python-firebase copied to clipboard

Alternative to multiprocessing?

Open kevinchau opened this issue 9 years ago • 4 comments

Having an issue using this on App Engine

ERROR    2015-03-16 21:37:06,549 wsgi.py:263] 
Traceback (most recent call last):
 File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
   handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
 File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
   handler, path, err = LoadObject(self._handler)
 File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
   obj = __import__(path[0])
 File "/Users/kevinchau/Dev/airfare/main.py", line 9, in <module>
   from firebase import firebase
 File "/Users/kevinchau/Dev/airfare/lib/firebase/__init__.py", line 3, in <module>
   from .async import process_pool
 File "/Users/kevinchau/Dev/airfare/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
INFO     2015-03-16 21:37:06,557 module.py:737] default: "GET /blast HTTP/1.1" 500 -

Is there an alternative to multiprocessing?

kevinchau avatar Mar 16 '15 21:03 kevinchau

I'm having the same issue. Any answer?

javamo avatar Apr 27 '15 14:04 javamo

Same issue here. It's surprising to see so few postings about the use of Firebase on Google Appengine on the internet.

puruzio avatar May 20 '15 04:05 puruzio

@puruzio @kevinchau This library doesn't work in GAE and they still have no plans to do it. The best you can do is to create/reuse a simple wrapper around the REST api (for the methods you need). The library to generate the tokens works well.

javamo avatar May 20 '15 14:05 javamo

If you are not using the async methods you can workaround the issue by disabling the multiprocessing (that's my case...).

class dummy:
    def close(self):
        pass
    def join(self):
        pass
    def terminate(self):
        pass

class DummyProccessing(ModuleType):
    def __init__(self):
        pass
    @staticmethod
    def Pool(processes):
        return dummy()

sys.modules['firebase.async.process_pool'] = dummy()
sys.modules['multiprocessing'] = DummyProccessing

from firebase import firebase

idanya avatar Oct 14 '15 08:10 idanya