title: PySpark on Linux with pycharm - first exception error
body: <p>I am trying to run my first PySpark script on a Linux VM I configured. The error message I have is <code>KeyError: SPARK_HOME</code> when I run the following: </p>
  
  <pre><code>from os import environ
  from pyspark import SparkContext
  
  </code></pre>
  
  <p>I momentarily made this error go away by running <code>export SPARK_HOME=~/spark-2.4.3-bin-hadoop2.7</code>. I then ran into a new error <code>error=2, No such file or directory</code>. Searching took me to this page:<a href="https://community.cloudera.com/t5/Community-Articles/Tutorial-Install-Configure-iPython-and-create-run-PySpark/ta-p/246400" rel="nofollow noreferrer">https://community.cloudera.com/t5/Community-Articles/Tutorial-Install-Configure-iPython-and-create-run-PySpark/ta-p/246400</a>. I then ran <code>export PYSPARK_PYTHON=~/python3*</code>. This brings me back to experiencing the <code>KeyError: SPARK_HOME</code> error. </p>
  
  <p>Honestly, I'm stumbling through this, because it's my first time configuring Spark, and using PySpark. I still don't quite understand the ins-and-outs of pycharm, as well. </p>
  
  <p>I expect to be able to run the following basic sample script on this page: <a href="https://medium.com/parrot-prediction/integrating-apache-spark-2-0-with-pycharm-ce-522a6784886f" rel="nofollow noreferrer">https://medium.com/parrot-prediction/integrating-apache-spark-2-0-with-pycharm-ce-522a6784886f</a> with no issues.</p>