First pyspark code in jupyter lab executed with error message

Hi,

I am new user of Jupyter lab
I run my first pyspark code in Jupyter lab(launch from Anaconda) and it is getting error message(refer to screen shot).
I have installed JDK 17, python 3.12.4, pyspark 3.5.5.

Can you anyone experience the same error message? Thank you.

pyspark code from online resource.

from pyspark.sql import SparkSession

Create a Spark session

spark = SparkSession.builder
.appName(“SimpleApp”)
.getOrCreate()

Sample data

data = [(“Erix”, 20), (Cindy", 10), (“Dave”, 25)]

Create a DataFrame from the data

df = spark.createDataFrame(data, [“Name”, “Age”])

Show the DataFrame content

df.show()

Stop the Spark session

spark.stop()

type or paste code here

![Screenshot 2025-05-05 174118|690x393](upload://lBAmRzPkx7c99x33zATbC8qoZ4g.png)

Please don’t point to a screenshot for an error message. (Aside from the fact it wasn’t place in here in a way that works. Or the automoderating blocked it.) Put it as text in the post. Preferably the entire error message. If it is very long then post it at a snipper sharing service, like GitHub’s gist and provide a link.

Please read Getting good answers to your questions and follow it as a guide. In fact, the last reference there, 'How do I ask a good question? emphasizes in bold out on such forums that images never suffice.

For one thing, the way the system links related things is through text and if there is no text it won’t get seen by the correct eyes. So it is in your interest to follow guidelines.

With the little you have provided, it is hard to tell if you have even the correct forum. If you ran this directly in Python, would similar things happen?