gpt4 book ai didi

multithreading - 2.7转换后Mapreduce不再起作用

转载 作者:行者123 更新时间:2023-12-03 13:16:09 25 4
gpt4 key购买 nike

在将我们的应用程序转换为Python 2.7之后,进行多线程配置,并像这样在app.yaml中引用mapreduce ...

- url: /mapreduce(/.*)?
script: mapreduce.main.app
#script: google.appengine.ext.mapreduce.main.app
login: admin

并像这样调用mapreduce ...
  control.start_map(
"FNFR",
"fnfr.fnfrHandler",
"mapreduce.input_readers.BlobstoreLineInputReader",
{"blob_keys": blobKey},
shard_count=32,
mapreduce_parameters={'done_callback': '/fnfrdone','blobKey': blobKey, 'userID':thisUserID})

我们得到以下堆栈跟踪...
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 189, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 241, in _LoadHandler
raise ImportError('%s has no attribute %s' % (handler, name))
ImportError: <module 'mapreduce.main' from '/base/data/home/apps/s~xxxxxxonline/2.361692533819432574/mapreduce/main.pyc'> has no attribute app

我找到了一个SO引用( How to migrate my app.yaml to 2.7?),但是正如您从我的Yaml中看到的那样,我认为我已经尝试了所有组合以尝试解决它。谢谢。

最佳答案

这对我有用,但是我仍然使用的是旧版SDK,我不知道他们是否解决了这个问题:

- url: /mapreduce(/.*)?
script: mapreduce.main.APP
login: admin

关于multithreading - 2.7转换后Mapreduce不再起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12379954/

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