Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Importerrir: cannot import name SparkSession

avatar
Visitor

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
Visitor

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
Visitor

 

Below is the screenshot of my code and error message.

Shankar_0-1587225969288.png

 

avatar
Visitor

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 Member

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.