title: Installing spark on local machine - .getOrCreate sparksession does not finish
body: <p>I have installed spark on my local machine (Windows 10) following this guide: <a href="https://changhsinlee.com/install-pyspark-windows-jupyter/" rel="nofollow noreferrer">https://changhsinlee.com/install-pyspark-windows-jupyter/</a>.</p>
  <p>When launching the notebook from Anaconda and running:</p>
  <pre><code>spark_session = SparkSession\
          .builder\
          .master(&quot;local[*]&quot;)\
          .appName(&quot;Z_PA&quot;)\
          .getOrCreate()
  </code></pre>
  <p>It takes forever and does not finish (at least in 60 min).</p>
  <p>Prior to this i got the error &quot;java-gateway-process-exited-before...&quot;. After reading this tread: &quot;https://stackoverflow.com/questions/31841509/pyspark-exception-java-gateway-process-exited-before-sending-the-driver-its-po &quot; I installed following versions and changed directories without spaces.</p>
  <p>I dowloaded and installed:</p>
  <ul>
  <li>java version &quot;1.8.0_202&quot;</li>
  <li>Anaconda: conda 4.11.0</li>
  <li>Python: Python 3.8.5</li>
  <li>Spark: spark-3.0.3-bin-hadoop2.7
  <ul>
  <li>winutils.exe (added to bin folder)</li>
  </ul>
  </li>
  </ul>
  <p>Spark is stored in: C:\spark. Java is stored in: C:\Java
  I have added both in my &quot;Environment vairables: User variables for...&quot;</p>
  <ul>
  <li>SPARK_HOME=C:\spark\spark-3.0.3-bin-hadoop2.7</li>
  <li>HADOOP_HOME= C:\spark\spark-3.0.3-bin-hadoop2.7</li>
  <li>JAVA_HOME=C:\Java\jdk1.8.0_202</li>
  <li>PYSPARK_DRIVER_PYTHON=jupyter</li>
  <li>PYSPARK_DRIVER_PYTHON_OPTS=notebook</li>
  <li>and corresponding \bin filepath of spark and java to my path system variables.</li>
  </ul>
  <p>I have installed pyspark and findspark as well.
  These lines of code executes without any issues:</p>
  <pre><code>import findspark
  findspark.init('C:\spark\spark-3.0.3-bin-hadoop2.7')
  findspark.find()
  import pyspark # only run after findspark.init()
  from pyspark import SparkContext
  from pyspark.sql import SparkSession
  </code></pre>
  <p>Anyone who knows why it takes so long time to get a sparksession? Anything in my installation that seems to be incorrect?</p>