0

I am using Apache Spark on Windows 10 64 bit machine. I have installed Java, Python 3.6 ,spark-2.3.1-bin-hadoop2.7. I am using VSCode editor for PySpark codeing.

When I'm executing the Python spark code in VSCode using spark-submit, it is showing

Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

and is terminating the execution.

Relevant code:

from pyspark import SparkContext, SparkConf 
if name == "main": 
    conf = SparkConf().setAppName("word count").setMaster("local[2]") 
    sc = SparkContext(conf=conf) 
    lines = sc.textFile("in/word_count.text") 
    words = lines.flatMap(lambda line: line.split(" ")) 
    wordcounts = words.countByValue() 
    for word, count in wordcounts.items(): 
        print("{} : {}".format(word,count))

Spark Execution Error:

Spark Execution Error

2
  • Please add your code and exception as text instead of an image. Also, that's just a warning and would not cause termination of the program. It'd be helpful if you can add the entire code (assuming it's not too big), a minimal reproducible example. Commented Sep 6, 2018 at 9:50
  • Hi, I am getting the same waring message when executing the pyspark command from windows command prompt. Commented Sep 6, 2018 at 12:52

1 Answer 1

3

You can safely ignore the warning as it is not the reason behind your shutdown call. According to documentation:

The native hadoop library is supported on *nix platforms only. The library does not to work with Cygwin or the Mac OS X platform.

The native hadoop library is mainly used on the GNU/Linus platform and has been tested on these distributions:

RHEL4/Fedora Ubuntu Gentoo On all the above distributions a 32/64 bit native hadoop library will work with a respective 32/64 bit jvm.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this is reassuring. Does that apply to Windows as well?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.