Winutils Exe Hadoop For Maclastevil

Posted By admin On 29/12/21
  1. Winutils.exe Hadoop Download
  2. Winutils.exe In The Hadoop Binaries
  3. Winutils.exe
  4. Winutils.exe Hadoop 2.7
  5. Winutils.exe Hadoop

This guide on PySpark Installation on Windows 10 will provide you a step by step instruction to make Spark/Pyspark running on your local windows machine. Most of us who are new to Spark/Pyspark and begining to learn this powerful technology wants to experiment locally and uderstand how it works. This guide will also help to understand the other dependend softwares and utilities which are needed to run Spark/Pyspark on your local windows 10 machine. At the end of the guides, you will be able to answer and practice following points

Step 3: Set the System level environment variable HADOOPHOME=C: winutilshadoop and include it in PATH as well (include the name till bin when adding to PATH) Step 4: Run the cmd prompt as Administrator and execute the command-winutils.exe chmod -R 777 C: tmp hive. Ensure you have the folder c: tmp hive. 问题在windows 环境使用Java下调试远程虚拟机中的Hadoop集群报错,问题很奇怪,说是少了 winutils.exe 文件,而且少了HADOOPHOME 的环境变量;我是部署在虚拟机CentOS 7 上的集群,难道Windows 上使用 它的Hadoop还需要自己安装环境,事实上,是真的。.

  1. Can PySpark be installed on Windows 10?
  2. Do I need Java 8 or higher version to run Spark/PySpark? and why?
  3. Do I need Python pre-installed and if yes, which version?
  4. Do I need Hadoop or any other distributed storage to run Spark/PySpark?
  5. How much memory and space required to run Spark/PySpark?
  6. Can be Spark(Scala) also be executed side by side PySpark?
  7. Can I load data from local file system or only Hadoop or other distributed system?
  8. Do I need multi core processor to run Spark/PySpark?
  9. Can I access PySpark using Jupyter notebook?
  10. Can I use the same installation using PyCharm IDE?
  11. What is PySpark interactive shell and how to use it?
  12. Can I run spark program in cluster mode in local Windows environment and what are the limitations?
  13. When the Spark is running, other programs and software can be executed in parallel?

PySpark Interactive ShellInstallation on Windows machine is fairly easy and straight forward task. Setting up pySpark interactive shell needs certain predefined softeare. This tutorial will help you to with a step by step instruction to set it up.


Winutils.exe Hadoop Download

PySpark Interactive Shell on Windows Pre-requisit

So the first thing when we talk about Spark is to make sure that your Windows installation has a working Java version. So to check that is very easy, we type Java - version and so it pops up. So here we have runtime environment at 1.8, and you might have something slightly different, it's fine, as long as you have Java you are good to go.

So next thing to do is to make sure you have a Python installation on your Windows. It is better to have winpython, and to make sure that you have the right Python version all you need to do is do Python - hyphens version and you get your current version number. And as long as it's anywhere near 3.6 it should be fine, 3.7 even better

Download Spark or PySpark

Winutils.exe In The Hadoop Binaries

To download Spark or pySpark all you need to do is go to the Spark home page and click on download. You can choose a Spark release (2.3.2). And then you can also choose a package type which determines which Hadoop version you're going to need (pre-built Hadoop 2.7 and later). Once selected, just click on 'Downloaded Spark' the Spark files from the internet. The download will get a zipped file which need to unzipped it into a folder on your local drive.


So let's first navigate to the relevant folder (or local drive) where the file is unzipped. And then the next thing to do is to run the PySpark command in the binary folder. As you can see, there are some warnings and some information is quite a bit of information here. But the important thing is we have Spark showing up, and it says you know version 2.3, welcome to Spark. And so let's look at a little bit at how we can resolve these errors.

Hadoop Winutils Utility for PySpark

One of the issues that the console shows is the fact that PySpark is reporting an I/O exception from the Java underlying library. And what it is saying is that it could not locate the executable when winutils. This executables is a mock program which mimic Hadoop distribution file system in windows machine.

Next thing to do is to go into the Hadoop footer and then make a bin folder. So we now have, inside our Spark path, we have a Hadoop folder which inside will have a bin folder. Inside this bin folder we're going to go to GitHub and download the relevance when utils executable, and that's, we need to download executable in a version that is consistent with the Hadoop version we're using, in this case is Hadoop 2.7.

SPARK_HOME & HADOOP_HOME Environment Variables

When you execute spark-folder>/bin/pyspark.bat file, it try to find 2 environment variables from windows Operating system. SPARK_HOME and HADOOP_HOME are the two variables which it look for.

If you have admin privileges on your Windows machine, then you can set those variables or you can you open a command prompt and set them using set command

Now you start the /bin/pyspark.bat and your interactive shell appears without any errors.

To exit the pySpark interactive shell, run >exit();

You can get complet PySpark tutorial, you can follow pySpark tutorial guide.

Additional PySpark Resource & Reading Material

PySpark Frequentl Asked Question

Refer our PySpark FAQ space where important queries and informations are clarified. It also links to important PySpark Tutorial apges with-in site.

PySpark Examples Code

Find our GitHub Repository which list PySpark Example with code snippet

PySpark/Spark Related Interesting Blogs

Here are the list of informative blogs and related articles, which you might find interesting

Apache Spark is becoming very popular among organizations looking to leverage its fast, in-memory computing capability for big-data processing. This article is for beginners to get started with Spark Setup on Eclipse/Scala IDE and getting familiar with Spark terminologies in general –

Hope you have read the previous article on RDD basics, to get a basic understanding of Spark RDD.

Tools Used :

  • Scala IDE for Eclipse – Download the latest version of Scala IDE from here. Here, I used Scala IDE 4.7.0 Release, which support both Scala and Java
  • Scala Version – 2.11 ( make sure scala compiler is set to this version as well)
  • Spark Version 2.2 ( provided in maven dependency)
  • Java Version 1.8
  • Maven Version 3.3.9 ( Embedded in Eclipse)
  • winutils.exe

For running in Windows environment , you need hadoop binaries in windows format. winutils provides that and we need to set hadoop.home.dir system property to bin path inside which winutils.exe is present. You can download winutils.exehere and place at path like this – c:/hadoop/bin/winutils.exe . Read this for more information.

Creating a Sample Application in Eclipse –

In Scala IDE, create a new Maven Project –

Replace POM.XML as below –


For creating a Java WordCount program, create a new Java Class and copy the code below –

Java Code for WordCount

import java.util.Arrays;

import org.apache.spark.SparkConf;

import scala.Tuple2;


public class JavaWordCount {
public static void main(String[] args) throws Exception {

String inputFile = “src/main/resources/input.txt”;

System.setProperty(“hadoop.home.dir”, “c://hadoop//”);

//Initialize Spark Context
JavaSparkContext sc = new JavaSparkContext(new SparkConf().setAppName(“wordCount”).setMaster(“local[4]”));

// Load data from Input File.
JavaRDD<String> input = sc.textFile(inputFile);

// Split up into words.
JavaPairRDD<String, Integer> counts = input.flatMap(line -> Arrays.asList(line.split(” “)).iterator())
.mapToPair(word -> new Tuple2<>(word, 1)).reduceByKey((a, b) -> a + b);



Scala Version

For running the Scala version of WordCount program in scala, create a new Scala Object and use the code below –

Winutils Exe Hadoop For Maclastevil

You may need to set project as scala project to run this, and make sure scala compiler version matches Scala version in your Spark dependency, by setting in build path –

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object ScalaWordCount {

def main(args: Array[String]) {

System.setProperty(“hadoop.home.dir”, “c://hadoop//”);
// create Spark context with Spark configuration
val sc = new SparkContext(new SparkConf().setAppName(“Spark WordCount”).setMaster(“local[4]”))

//Load inputFile
val inputFile = sc.textFile(“src/main/resources/input.txt”)
val counts = inputFile.flatMap(line => line.split(” “)).map(word => (word, 1)).reduceByKey((a, b) => a + b)




So, your final setup will look like this –

Running the code in Eclipse

Winutils.exe hadoop download

You can run the above code in Scala or Java as simple Run As Scala or Java Application in eclipse to see the output.


Winutils.exe Hadoop 2.7

Now you should be able to see the word count output, along with log lines generated using default Spark log4j properties.

In the next post, I will explain how you can open Spark WebUI and look at various stages, tasks on Spark code execution internally.

You may also be interested in some other BigData posts –

Winutils.exe Hadoop

  • Spark ; How to Run Spark Applications on Windows