Error: not found: value sc

scala> val rdd=sc.textFile(“README.md”)
:17: error: not found: value sc
val rdd=sc.textFile(“README.md”)
^

Please tell me how to resolve this.

I’m running spark 2.1.0

If not resolved the issue …

In spark 2.1 spark context is available as spark session (sc as spark) . so use

spark.textFile(“README.md”) it will work …

Hi all,
I have the same issue and is not working even using spark instide of sc.
val rdd=spark.textFile(“README.md”)
I am using spark 2.1.1, windows 10 using virtualbox.
please help me.