在python中映射reduce程序时出错

在python中映射reduce程序时出错,python,python-2.7,mapreduce,elastic-map-reduce,Python,Python 2.7,Mapreduce,Elastic Map Reduce,我正在本地系统上用python执行Map reduce程序,并得到以下错误: Password:Traceback (most recent call last): File "./wordcount_mapper.py", line 7, in <module> filename = os.environ["mapreduce_map_input_file"] File "/System/Library/Frameworks/Python.framework/Ver

我正在本地系统上用python执行Map reduce程序,并得到以下错误:

Password:Traceback (most recent call last):
  File "./wordcount_mapper.py", line 7, in <module>
    filename = os.environ["mapreduce_map_input_file"]
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
KeyError: 'mapreduce_map_input_file'
密码:回溯(最近一次呼叫最后一次):
文件“/wordcount\u mapper.py”,第7行,在
filename=os.environ[“mapreduce\u map\u input\u文件”]
文件“/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py”,第23行,在__
升起钥匙错误(钥匙)
KeyError:“mapreduce\u映射\u输入\u文件”

检查您的环境变量
mapreduce\u map\u input\u文件
以查看是否已设置


在终端中键入
echo$mapreduce\u map\u input\u file
。如果未设置,终端将不会打印任何内容。

是的,它是空白的,您能告诉我如何设置它吗,因为我是map Reduce的新手。这是map Reduce程序的输入文件。因此,您只需将其设置为输入文件的路径。无论如何,您应该再次阅读您正在阅读的教程,或者在网上查找有关此内容的任何相关教程。他们肯定会有一些示例文件供您使用