Skip to content

Instantly share code, notes, and snippets.

@arivero
Forked from mGalarnyk/.bashrc
Created February 1, 2019 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arivero/71d9531f0189c4df3c4134ddce48fdd0 to your computer and use it in GitHub Desktop.
Save arivero/71d9531f0189c4df3c4134ddce48fdd0 to your computer and use it in GitHub Desktop.
Function to append to the end of .bashrc file in linux to run PySpark on jupyter notebook for the blog post https://medium.com/@GalarnykMichael/install-spark-on-ubuntu-pyspark-231c45677de0#.qxguj5czj
function snotebook ()
{
#Spark path (based on your computer)
SPARK_PATH=~/spark-2.0.0-bin-hadoop2.7
export PYSPARK_DRIVER_PYTHON="jupyter"
export PYSPARK_DRIVER_PYTHON_OPTS="notebook"
# For python 3 users, you have to add the line below or you will get an error
#export PYSPARK_PYTHON=python3
$SPARK_PATH/bin/pyspark --master local[2]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment