<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Difference between running pyspark code by using commend python3 and pyspark in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/difference-between-running-pyspark-code-by-using-commend-python3/m-p/17621#M11606</link>
    <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I am confused by what's difference between running code using command &lt;PRE&gt;&lt;CODE&gt;python3 CODENAME.py&lt;/CODE&gt;&lt;/PRE&gt; and launch it by commend &lt;PRE&gt;&lt;CODE&gt;pyspark&lt;/CODE&gt;&lt;/PRE&gt; and start working on the code.&lt;/P&gt;
&lt;P&gt;When I run the code : &lt;PRE&gt;&lt;CODE&gt;spark = SparkSession.builder.config("spark.driver.memory", "16").appName("EDA").getOrCreate()&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;
&lt;P&gt;The first way &lt;PRE&gt;&lt;CODE&gt;python3 CODENAME.py&lt;/CODE&gt;&lt;/PRE&gt; raises the error even if I have already done &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export SPARK_HOME=/home/twotwo/anaconda3/envs/yolov5/lib/python3.8/site-packages/pyspark
export PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.9-src.zip:$PYTHONPATH
export PATH=$SPARK_HOME/python:$PATH&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;the error mseeage look like :&lt;/P&gt;
&lt;P&gt;
 &lt;/P&gt;&lt;P&gt;Exception: Java gateway process exited before sending its port number&lt;/P&gt;

&lt;P&gt;However ,the second way runs the code without any problem , I would like to know what's the difference between these two ways.Thanks&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Jul 2021 03:50:29 GMT</pubDate>
    <dc:creator>twotwoiscute</dc:creator>
    <dc:date>2021-07-17T03:50:29Z</dc:date>
    <item>
      <title>Difference between running pyspark code by using commend python3 and pyspark</title>
      <link>https://community.databricks.com/t5/data-engineering/difference-between-running-pyspark-code-by-using-commend-python3/m-p/17621#M11606</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I am confused by what's difference between running code using command &lt;PRE&gt;&lt;CODE&gt;python3 CODENAME.py&lt;/CODE&gt;&lt;/PRE&gt; and launch it by commend &lt;PRE&gt;&lt;CODE&gt;pyspark&lt;/CODE&gt;&lt;/PRE&gt; and start working on the code.&lt;/P&gt;
&lt;P&gt;When I run the code : &lt;PRE&gt;&lt;CODE&gt;spark = SparkSession.builder.config("spark.driver.memory", "16").appName("EDA").getOrCreate()&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;
&lt;P&gt;The first way &lt;PRE&gt;&lt;CODE&gt;python3 CODENAME.py&lt;/CODE&gt;&lt;/PRE&gt; raises the error even if I have already done &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export SPARK_HOME=/home/twotwo/anaconda3/envs/yolov5/lib/python3.8/site-packages/pyspark
export PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.10.9-src.zip:$PYTHONPATH
export PATH=$SPARK_HOME/python:$PATH&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;the error mseeage look like :&lt;/P&gt;
&lt;P&gt;
 &lt;/P&gt;&lt;P&gt;Exception: Java gateway process exited before sending its port number&lt;/P&gt;

&lt;P&gt;However ,the second way runs the code without any problem , I would like to know what's the difference between these two ways.Thanks&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 03:50:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/difference-between-running-pyspark-code-by-using-commend-python3/m-p/17621#M11606</guid>
      <dc:creator>twotwoiscute</dc:creator>
      <dc:date>2021-07-17T03:50:29Z</dc:date>
    </item>
  </channel>
</rss>

