gpt4 book ai didi

python - Webapp2 Google App Engine Firebase 导入错误

转载 作者:太空宇宙 更新时间:2023-11-03 15:58:55 26 4
gpt4 key购买 nike

我想在我的应用引擎项目中使用 Firebase。我已按照 documentation 中提到的说明进行操作用于使用第三方库。每当我尝试导入 Firebase 时:

from firebase import firebase
firebase = firebase.FirebaseApplication('ttps://myapp-c1367.firebaseio.com', None)
result = firebase.get('/users', None)
print result

它给出了以下错误:

Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1535, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1529, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Users\shaizi\PycharmProjects\simpletestapp - MVC\controllers\Handlers.py", line 24, in dispatch
webapp2.RequestHandler.dispatch(self)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "C:\Users\shaizi\PycharmProjects\simpletestapp - MVC\controllers\Login.py", line 45, in get
from firebase import firebase
File "C:\Users\shaizi\PycharmProjects\simpletestapp - MVC\lib\firebase\__init__.py", line 3, in <module>
from .async import process_pool
File "C:\Users\shaizi\PycharmProjects\simpletestapp - MVC\lib\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 41, in <module>
from subprocess import _args_from_interpreter_flags
ImportError: cannot import name _args_from_interpreter_flags

请帮忙。我哪里做错了?

最佳答案

错误是由于 firebase 包导入了 python 的 multiprocessing 包,而后者又试图导入 subprocess 包。

Appengine 标准运行时环境不允许导入 subprocess,因为 Appengine 不允许后台进程。

如果您想在您的应用中使用 Firebase,您将使用 REST API 与它进行通信。 ,或将您的项目移动到 flexible environment或 Compute Engine 上的自定义运行时。

关于python - Webapp2 Google App Engine Firebase 导入错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41619475/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com