Skip to content

Instantly share code, notes, and snippets.

@mGalarnyk
Last active February 1, 2019 16:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mGalarnyk/194ebbc10873d4baa4df923b26f68b24 to your computer and use it in GitHub Desktop.
Save mGalarnyk/194ebbc10873d4baa4df923b26f68b24 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