title: Creating Spark Session throws exception traceback
body: <p>I'm new to jupyter notebook, and I'm trying to run a pyspark code, which is shorted as below:</p>
  <pre><code>import pyspark as ps
  from pyspark.sql import SQLContext
  from pyspark.sql import Row
  
  spark = ps.sql.SparkSession.builder \
              .master(&quot;local&quot;) \
              .appName(&quot;Book Recommendation System&quot;) \
              .getOrCreate()
  </code></pre>
  <p>I get errors for creating pyspark session with following statements:</p>
  <ul>
  <li>&quot;This SparkContext may be an existing one&quot;</li>
  <li>&quot;Do not update <code>SparkConf</code> for existing <code>SparkContext</code>, as it's shared by all sessions&quot;</li>
  </ul>
  <p>Full error explanation looks like below:</p>
  <pre><code>&gt; ---------------------------------------------------------------------------
  Exception                                 Traceback (most recent call last)
  &lt;ipython-input-21-cd9ecd052473&gt; in &lt;module&gt;
  ----&gt; 1 spark = ps.sql.SparkSession.builder.master(&quot;local&quot;).appName(&quot;Book&quot;).getOrCreate()
        2 
        3 sc = spark.sparkContext
        4 sqlContext = SQLContext(sc)
  
  c:\program files (x86)\python\lib\site-packages\pyspark\sql\session.py in getOrCreate(self)
      184                             sparkConf.set(key, value)
      185                         # This SparkContext may be an existing one.
  --&gt; 186                         sc = SparkContext.getOrCreate(sparkConf)
      187                     # Do not update `SparkConf` for existing `SparkContext`, as it's shared
      188                     # by all sessions.
  
  c:\program files (x86)\python\lib\site-packages\pyspark\context.py in getOrCreate(cls, conf)
      369         with SparkContext._lock:
      370             if SparkContext._active_spark_context is None:
  --&gt; 371                 SparkContext(conf=conf or SparkConf())
      372             return SparkContext._active_spark_context
      373 
  
  c:\program files (x86)\python\lib\site-packages\pyspark\context.py in __init__(self, master, appName, sparkHome, pyFiles, environment, batchSize, serializer, conf, gateway, jsc, profiler_cls)
      126                 &quot; is not allowed as it is a security risk.&quot;)
      127 
  --&gt; 128         SparkContext._ensure_initialized(self, gateway=gateway, conf=conf)
      129         try:
      130             self._do_init(master, appName, sparkHome, pyFiles, environment, batchSize, serializer,
  
  c:\program files (x86)\python\lib\site-packages\pyspark\context.py in _ensure_initialized(cls, instance, gateway, conf)
      318         with SparkContext._lock:
      319             if not SparkContext._gateway:
  --&gt; 320                 SparkContext._gateway = gateway or launch_gateway(conf)
      321                 SparkContext._jvm = SparkContext._gateway.jvm
      322 
  
  c:\program files (x86)\python\lib\site-packages\pyspark\java_gateway.py in launch_gateway(conf, popen_kwargs)
      103 
      104             if not os.path.isfile(conn_info_file):
  --&gt; 105                 raise Exception(&quot;Java gateway process exited before sending its port number&quot;)
      106 
      107             with open(conn_info_file, &quot;rb&quot;) as info:
  
  Exception: Java gateway process exited before sending its port number
  </code></pre>
  <p>Does anyone know what should I do?
  I have no idea what's the problem!</p>