[Python] Error while running first Pyspark program in Jupyter

Discussão em 'Python' iniciado por Stack, Fevereiro 14, 2025.

  1. Stack

    Stack Membro Participativo

    I am a beginner in Pyspark, trying to execute few lines of code in a Jupyter notebook. I have followed the instructions available(pretty old - https://changhsinlee.com/install-pyspark-windows-jupyter/) in the internet to configure Pyspark post installing Python-3.8.5, Java(jdk-16), spark-3.1.1-bin-hadoop2.7.

    Below are the lines which got executed successfully post installation and throws exception after 'df.show()'.I have added all necessary environment variables. Please help me to resolve this.

    pip install pyspark

    pip install findspark

    import findspark

    findspark.init()

    import pyspark

    from pyspark.sql import SparkSession

    spark=SparkSession.builder.getOrCreate()

    df=spark.sql('''Hello''')

    df.show() Exception

    Added error in the comments section.

    Note: I am a beginner in Python. Do not have java knowledge

    Continue reading...

Compartilhe esta Página