开发者

Getting error "ImportError: Could not find 'input_readers' on path 'map reduce'" trying to start mapReduce job

开发者 https://www.devze.com 2023-04-13 04:22 出处:网络
I\'m getting this error... \"ImportError: Could not find \'input_readers\' on path \'map reduce\'\" when trying to Run my map reduce job via the http://localhost:8080/mapreduce launcher page.

I'm getting this error... "ImportError: Could not find 'input_readers' on path 'map reduce'" when trying to Run my map reduce job via the http://localhost:8080/mapreduce launcher page.

It looks like my problem is similar to this post, AppEngine mapper API import error. Unfortunately, no definitive answers were given.

I've simplified it down to this tiny testmapreduce.py:

from google.appengine.ext import db

class TestEntity(db.Model):
    value = db.StringProperty()

def mapperhandler(test):
    print test.value
    return

And my mapreduce.yaml:

mapreduce:
- name: Simplest MapReduce
  mapper:
    handler: testmapreduce.mapperhandler
    input_reader: mapreduce.input_readers.DatastoreInputReader
    params:
    - name: entity_kind
      default: testmapreduce.TestEntity

One possible clue is the presence of __init__.py has no effect (whether in the project root, the mapreduce directory, or both). I'm sure I'm making a beginner mistake, but over the last couple of days I have read every bit of documentation, and all the examples I can find. Thanks.

UPDATE: I get the same error trying to invoke it via...

control.start_map(
   "Give awards",
   "testmapreduce.mapperhandler",
   "mapreduce.input_readers.DatastoreInputReader",
   {"entity_kind": "testmapreduce.TestEntity"},
   shard_count=10)

UPDATE: As requested, the stack trace -- let me know what else would be helpful...

ERROR    2011-10-16 17:09:27,216 _webapp25.py:464] Could not find 'input开发者_运维问答_readers' on path 'mapreduce'
Traceback (most recent call last):
 File "/Develop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__
   handler.get(*groups)
 File "/Users/lc/PycharmProjects/mrtest/testmapreduce.py", line 22, in get
   shard_count=10)      # handle web form test interface
 File "/Users/lc/PycharmProjects/mrtest/mapreduce/control.py", line 94, in start_map
   transactional=transactional)
 File "/Users/lc/PycharmProjects/mrtest/mapreduce/handlers.py", line 811, in _start_map
   mapper_input_reader_class = mapper_spec.input_reader_class()
 File "/Users/lc/PycharmProjects/mrtest/mapreduce/model.py", line 393, in input_reader_class
   return util.for_name(self.input_reader_spec)
 File "/Users/lc/PycharmProjects/mrtest/mapreduce/util.py", line 94, in for_name
   module = for_name(module_name, recursive=True)
 File "/Users/lc/PycharmProjects/mrtest/mapreduce/util.py", line 102, in for_name
   short_name, module_name))
ImportError: Could not find 'input_readers' on path 'mapreduce'
INFO     2011-10-16 22:09:27,253 dev_appserver.py:4247] "GET /giveawards HTTP/1.1" 500 -


This problem turned out to be that I was using the 2.7 version of the Python Interpreter in my local environment. When I switched to 2.5, it works fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消