[Python] Unable to import SparkSession in Pyspark

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I have version 2.0 of Spark installed. I am using Pyspark, on Python 2.7. I seem to have no difficulties creating a SparkContext, but for some reason I am unable to import the SparkSession. Does anyone know what I am doing wrong?

    import pyspark
    import pyspark.sql
    from pyspark.sql import SparkSession


    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: cannot import name SparkSession

    Continue reading...

Compartilhe esta Página