Wednesday, December 24, 2014

Getting started with eclipse, apache spark and python



Ok, it took me a while to figure out how to configure eclipse to run python/spark so publishing steps to save bit of your time.

At the time of writing: 12/24/2104, I used following versions:

  • Eclipse Juno
  • Spark 1.2.0 (with Hadoop 2.4)
  • Python 2.7 (anaconda)
  • Windows 

Steps:
  1. Set environment variables
    1. Path, it should only include path to root and root\scripts dir of python 2 version
    2. PYTHONPATH, set it to python 2 root dir
    3. JAVA_HOME, set it to your java root dir. I am using oracle JDK 1.8
    4. SPARK_HOME, set it to your spark root dir
    5. HADOOP_HOME, set it to your hadoop dir
  2. On Window, hadoop doesn't have need common tools. Copy files from https://github.com/srccodes/hadoop-common-2.2.0-bin/archive/master.zip into your hadoop bin dir. This step is optional, without this step you will see Could not locate executable null\bin\winutils.exe in the Hadoop. and you will not be able to save data
  3. Eclipse
    1. Install and configure pydev. Google for instructions
    2. Install py4j for python version you are using.  I use "pip install py4j"
    3. In pydev->Interpreters->pthon interpreter
      1.  add path to python dir in spark, python lib, python script in python installation.  Below is the screenshot



And you are good to GO. 


31 comments:

  1. Hi Hitesh,

    Thanks for writing the blog, was very helpful. In eclipse , when I write a pyspark code, it is not able to find sparkconf.

    ReplyDelete
  2. Hi There,


    A really interesting, clear and easily readable
    Apache Spark, Eclipse and Python article of interesting and different perspectives' will clap. So much is so well covered here.

    I am writing a program. In a situation I want to print something and go to clear the screen but when I clear the screen the printed text also gets cleared. I want it such that after the print we have to click a key for the screen to get cleared. Is there a command or code which does that.
    It was cool to see your article pop up in my google search for the process yesterday. Great Guide.

    Keep up the good work!


    Grazie,
    Olive

    ReplyDelete
  3. • Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating IOT Online Training

    ReplyDelete
  4. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.

    rpa Training in Chennai

    rpa Training in bangalore

    rpa Training in pune

    blueprism Training in Chennai

    blueprism Training in bangalore

    blueprism Training in pune

    rpa online training

    ReplyDelete
  5. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.

    automation anywhere training in chennai

    automation anywhere training in bangalore

    automation anywhere training in pune

    automation anywhere online training

    blueprism online training

    rpa Training in sholinganallur

    rpa Training in annanagar

    ReplyDelete
  6. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    python training institute in chennai
    python training in velachery
    python training institute in chennai

    ReplyDelete
  7. I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
    Blueprism training in Chennai

    Blueprism training in Bangalore

    Blueprism training in Pune

    ReplyDelete
  8. The information which you have provided is very good. It is very useful who is looking for at machine learning online training Hyderabad

    ReplyDelete
  9. Pleasant Tips..Thanks for Sharing….We keep up hands on approach at work and in the workplace, keeping our business pragmatic, which recommends we can help you with your tree clearing and pruning in an invaluable and fit way.

    Microsoft Azure online training
    Selenium online training
    Java online training
    Python online training
    uipath online training

    ReplyDelete
  10. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    tally training in chennai

    hadoop training in chennai

    sap training in chennai

    oracle training in chennai

    angular js training in chennai

    ReplyDelete
  11. Away indicate image consumer carry specific. Late opportunity again.news today live

    ReplyDelete