title: Not able to run the PySpark code locally after
body: <p>I am not able to run the PySpark code which is imported from the data bricks after completing all required configuration setup for spark even though I am getting errors as shown below. Please help me with a solution.</p>
  <p>code:</p>
  <pre><code># Databricks notebook source
  from pyspark import SparkConf, SparkContext
  
  # COMMAND ----------
  
  conf = SparkConf().setAppName('Read File')
  
  # COMMAND ----------
  
  sc = SparkContext.getOrCreate(conf=conf)
  
  # COMMAND ----------
  
  text = sc.textFile('sample.txt')
  
  # COMMAND ----------
  
  print(text.collect())
  
  # COMMAND ----------
  
  sc.stop()
  # COMMAND ----------
  </code></pre>
  <p>Error:</p>
  <pre><code>C:\Users\Abhishikth\Desktop&gt;spark-submit 'fsc2.py'
  21/10/18 08:03:34 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
  Exception in thread &quot;main&quot; org.apache.spark.SparkException: Failed to get main class in JAR with error 'File file:/C:/Users/Abhishikth/Desktop/'fsc2.py' does not exist'.  Please specify one with --class.
          at org.apache.spark.deploy.SparkSubmit.error(SparkSubmit.scala:968)
          at org.apache.spark.deploy.SparkSubmit.prepareSubmitEnvironment(SparkSubmit.scala:486)
          at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:894)
          at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)
          at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)
          at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)
          at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1039)
          at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1048)
          at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
  </code></pre>