Support Questions

Find answers, ask questions, and share your expertise

Importerrir: cannot import name SparkSession

avatar
New Contributor

Hi,

 

I am using Cloudera Quickstart VM 5.13.0 to write code using pyspark.

 

Trying to import SparkSession using below command:

from pyspark.sql import SparkSession

 

It's throwing an error saying Importerrir: cannot import name SparkSession

 

I need help to fix this. Please suggest me if anything missed

1 ACCEPTED SOLUTION

avatar
New Contributor

Hi All,

 

I have fixed this issue by updating spark to 2.4.5 as SparkSession has introduced from 2.0.

 

Earlier, spark 1.6 was installed and could not proceed to import SparkSession.

 

Thanks all...!!!

 

Regards,

Shankar.

View solution in original post

3 REPLIES 3

avatar
New Contributor

 

Below is the screenshot of my code and error message.

Shankar_0-1587225969288.png

 

avatar
New Contributor

Hi All,

 

I have fixed this issue by updating spark to 2.4.5 as SparkSession has introduced from 2.0.

 

Earlier, spark 1.6 was installed and could not proceed to import SparkSession.

 

Thanks all...!!!

 

Regards,

Shankar.

avatar
New Contributor

Hello Shankar,

 

Please did the portal request username and password before allowing you to download Spark 2.4.5 ?

I have the same issue , but it ask me for credentials when I try to download. How do I get this credential? I have tried by just setting up an account, but that did not work.

 

Thanks

Lewi.