python中map reduce程序出错

2024-04-29 00:50:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在本地系统上用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'

Tags: inpy程序mapreduceinput系统错误
1条回答
网友
1楼 · 发布于 2024-04-29 00:50:30

检查环境变量mapreduce_map_input_file是否已设置。你知道吗

在终端中键入echo $mapreduce_map_input_file。如果不设置,终端就不会打印出任何内容。你知道吗

相关问题 更多 >