<?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>question How to specify Python version to use with Pyspark in Jupyter? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193059#M68543</link>
    <description>&lt;P&gt;Hello, I've installed Jupyter through Anaconda and I've pointed Spark to it correctly by setting the following environment variables in my bashrc file :&lt;/P&gt;&lt;P&gt;export PYSPARK_PYTHON=/home/ambari/anaconda3/bin/python&lt;BR /&gt;export PYSPARK_DRIVER_PYTHON=jupyter&lt;BR /&gt;export PYSPARK_DRIVER_PYTHON_OPTS='notebook --no-browser --ip 0.0.0.0 --port 9999'.&lt;/P&gt;&lt;P&gt;When i tap $python --version, i got  Python 3.5.2 :: Anaconda 4.2.0 (64-bit).&lt;/P&gt;&lt;P&gt;When i tap $which python, i got ~/anaconda3/bin/python.&lt;/P&gt;&lt;P&gt;So, i conclude that I'm using python 3 when i run PySpark in Jupyter. But, i got the error message shown in "result.png" when i used simple instruction in jupyter. So, there's a conflict in python version even if i updated &lt;/P&gt;&lt;P&gt;PYSPARK_PYTHON to /home/ambari/anaconda3/bin/python3 instead of /home/ambari/anaconda3/bin/python and refreshed my bashrc file.&lt;BR /&gt;so, how can i fix this issue and use Python 3?&lt;/P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="result.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/6272iCF434D08297A751D/image-size/large?v=v2&amp;amp;px=999" role="button" title="result.png" alt="result.png" /&gt;&lt;/span&gt;</description>
    <pubDate>Fri, 16 Sep 2022 12:17:42 GMT</pubDate>
    <dc:creator>kabadou_rawia</dc:creator>
    <dc:date>2022-09-16T12:17:42Z</dc:date>
    <item>
      <title>How to specify Python version to use with Pyspark in Jupyter?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193059#M68543</link>
      <description>&lt;P&gt;Hello, I've installed Jupyter through Anaconda and I've pointed Spark to it correctly by setting the following environment variables in my bashrc file :&lt;/P&gt;&lt;P&gt;export PYSPARK_PYTHON=/home/ambari/anaconda3/bin/python&lt;BR /&gt;export PYSPARK_DRIVER_PYTHON=jupyter&lt;BR /&gt;export PYSPARK_DRIVER_PYTHON_OPTS='notebook --no-browser --ip 0.0.0.0 --port 9999'.&lt;/P&gt;&lt;P&gt;When i tap $python --version, i got  Python 3.5.2 :: Anaconda 4.2.0 (64-bit).&lt;/P&gt;&lt;P&gt;When i tap $which python, i got ~/anaconda3/bin/python.&lt;/P&gt;&lt;P&gt;So, i conclude that I'm using python 3 when i run PySpark in Jupyter. But, i got the error message shown in "result.png" when i used simple instruction in jupyter. So, there's a conflict in python version even if i updated &lt;/P&gt;&lt;P&gt;PYSPARK_PYTHON to /home/ambari/anaconda3/bin/python3 instead of /home/ambari/anaconda3/bin/python and refreshed my bashrc file.&lt;BR /&gt;so, how can i fix this issue and use Python 3?&lt;/P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="result.png" style="width: 999px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/6272iCF434D08297A751D/image-size/large?v=v2&amp;amp;px=999" role="button" title="result.png" alt="result.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:17:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193059#M68543</guid>
      <dc:creator>kabadou_rawia</dc:creator>
      <dc:date>2022-09-16T12:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify Python version to use with Pyspark in Jupyter?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193060#M68544</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/39293/kabadourawia.html" nodeid="39293"&gt;@raouia &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Based on your result.png, you are actually using python 3 in jupyter, you need the parentheses after print in python 3 (and not in python 2). To make sure, you should run this in your notebook:&lt;/P&gt;&lt;PRE&gt;import sys
print(sys.version)&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Sep 2017 21:42:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193060#M68544</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2017-09-25T21:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to specify Python version to use with Pyspark in Jupyter?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193061#M68545</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3369/gnovak.html" nodeid="3369"&gt;@gnovak&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thank you so much. I was really confused about which version of Python that requires parentheses after print. I thought it was Python2. &lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2017 21:54:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-specify-Python-version-to-use-with-Pyspark-in-Jupyter/m-p/193061#M68545</guid>
      <dc:creator>kabadou_rawia</dc:creator>
      <dc:date>2017-09-25T21:54:17Z</dc:date>
    </item>
  </channel>
</rss>

