Python Hadoop streaming on windows, Script not a valid Win32 application

前端 未结 1 1458
無奈伤痛
無奈伤痛 2021-01-03 02:30

I have a problem to execute mapreduce python files on Hadoop by using Hadoop streaming.jar.

I use: Windows 10 64bit Python 3.6 and my IDE is spyder 3.2.6, Hadoop 2.3

相关标签:
1条回答
  • 2021-01-03 03:22

    Solution:

    1. I used Hadoop version 2.7.2 with almost same configuration for *.xml.
    2. I removed #!/usr/bin/python3 from top of my python code.

    I changed my command as:

    D:\hadoop\bin\hadoop jar
    D:\hadoop\share\hadoop\tools\lib\hadoop-streaming-2.7.2.jar
    -file /in/wordcount-mapper.py -mapper "python wordcount-mapper.py"
    -file /in/wordcount-reducer.py -reducer "python wordcount-reducer.py"
    -input /in/mahsa.txt -output /output
    

    Therefore I could get result.

    hadoop fs -cat /output/part-00000
    
    0 讨论(0)
提交回复
热议问题