gpt4 book ai didi

Python Appengine Mapreduce 在运行时给出 Bad Entity Kind

转载 作者:太空宇宙 更新时间:2023-11-03 11:57:00 25 4
gpt4 key购买 nike

我已经为此苦苦挣扎了几个小时......

在我的项目中,我在主根目录下的“项目”文件夹中定义了 models.py。我还在“项目”文件夹内的文件夹“mapreduce”中有 mapreduce 文件。文件系统如下所示:

主根
-项目文件夹
-> 模型.py
-> Mapreduce文件夹

我将 mapreduce.yaml 文件定义为:

mapreduce:
- name: Advice_Hidden
mapper:
input_reader: mapreduce.input_readers.DatastoreInputReader
handler: mapreduce.main_map_handler.add_hidden
params:
- name: entity_kind
default: project.models.Advice

但是当我尝试运行 mapreduce 时,出现错误:

BadReaderParamsError: Bad entity kind: Could not find 'models' on path 'advice'

谁能帮帮我?还应该注意,我也在使用 Django-Piston。

最佳答案

同样的问题,重新排列有效,但我现在无法重新排列我的文件夹结构。就我而言,我在“项目”目录下有一个 _init_.py。还尝试在app.yaml和mapreduce.yaml所在的根目录下添加一个_init_.py(无果)

奇怪的是,我的错误是不同的。使用您的示例,它将是

  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/mapreduce/input_readers.py", line 660, in validate
raise BadReaderParamsError("Bad entity kind: %s" % e)
BadReaderParamsError: Bad entity kind: **Could not find 'models' on path 'project'**

其实刚发现在production上是可以的,就是根目录(app.yaml所在的目录)在sys.path中。在sdk中它不是。需要找出原因。正在调查。

关于Python Appengine Mapreduce 在运行时给出 Bad Entity Kind,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5813293/

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