简体   繁体   English

Pydoop mapreduce“ AttributeError:模块'wordcount_minimal'没有属性'__main__'”

[英]Pydoop mapreduce “AttributeError: module 'wordcount_minimal' has no attribute '__main__'”

I installed Pydoop and am trying to run MapReduce jobs. 我安装了Pydoop并试图运行MapReduce作业。 Just to do a dry run, I tried executing the word count examples wordcount_minimal.py and wordcount_full.py . 只是为了进行试运行,我尝试执行单词计数示例wordcount_minimal.pywordcount_full.py Both of them hang at the map phase. 他们两个都挂在地图阶段。 In the end of the stderr , I find this message as per the script I run: stderr的末尾,我根据运行的脚本找到此消息:

module 'wordcount_minimal' has no attribute ' main ' 模块'wordcount_minimal'没有属性' main '

or 要么

module 'wordcount_full' has no attribute ' main ' 模块'wordcount_full'没有属性' main '

I executed the job using the command: 我使用以下命令执行了作业:

pydoop submit --upload-file-to-cache wordcount_full.py wordcount_full hdfs_input_dir hdfs_output_dir pydoop提交-上传文件到缓存wordcount_full.py wordcount_full hdfs_input_dir hdfs_output_dir

Unable to find the reason behind this. 无法找到其背后的原因。 Any idea what could be the reason? 知道是什么原因吗?

I was able to execute the example from the pydoop script using the map and reduce functions and it completed successfully. 我能够使用mappydoop script执行示例并reduce功能,并成功完成了该示例。 But with the pydoop submit option, I have this issue. 但是,使用pydoop submit选项,我遇到了这个问题。 Not sure if I am missing something. 不知道我是否想念一些东西。

PS: I have a cluster with 2 nodes running Hortonworks HDP 2.6.5 . PS:我有一个集群,其中有2个节点正在运行Hortonworks HDP 2.6.5 Pydoop is installed on both of them. Pydoop都安装在两者上。

By default, pydoop submit expects an entry point called __main__ , but you can modify this via --entry-point . 默认情况下,pydoop Submit需要一个名为__main__的入口点,但是您可以通过--entry-point进行修改。 For instance, if your code is: 例如,如果您的代码是:

class Mapper ...
class Reducer ...
def run():
    pipes.run_task(pipes.Factory(Mapper, Reducer))

You can run it via pydoop submit --entry-point run ... 您可以通过pydoop submit --entry-point run ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError:模块'__main__'没有属性'cleaner' - AttributeError: module '__main__' has no attribute 'cleaner' AttributeError: 模块 '__main__' 没有属性 'AverageWordLengthExtractor' - AttributeError: module '__main__' has no attribute 'AverageWordLengthExtractor' pickle/joblib AttributeError: 模块 &#39;__main__&#39; 在 pytest 中没有属性 &#39;thing&#39; - pickle/joblib AttributeError: module '__main__' has no attribute 'thing' in pytest unittest:AttributeError:模块'__main__'没有属性'C:\ ...' - unittest: AttributeError: module '__main__' has no attribute 'C:\…' TensorFlow:模块&#39;__main__&#39;没有属性&#39;main&#39; - TensorFlow: module '__main__' has no attribute 'main' 查找“pip”的模块规范时出错(AttributeError:模块“__main__”没有属性“__file__”) - Error while finding module specification for 'pip' (AttributeError: module '__main__' has no attribute '__file__') 排序apache梁wordcount_minimal输出 - Sorting apache beam wordcount_minimal output 用于单元测试的python3:AttributeError:模块&#39;__main__&#39;没有属性“内核......” - python3 for unit test: AttributeError: module '__main__' has no attribute “kernel…” Python多处理错误:AttributeError:模块&#39;__main__&#39;没有属性&#39;__spec__&#39; - Python Multiprocessing error: AttributeError: module '__main__' has no attribute '__spec__' AttributeError的: - AttributeError: <module '__main__' from [..] does not have the attribute 'open'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM