title: In pySpark I am getting py4j.protocol.Py4JError: py4j.Py4JException: Method isBarrier([]) does not exist
body: <p>This exception is rising at <code>lines.count()</code>.</p>
  
  <blockquote>
    <p>Exception has occurred: py4j.protocol.Py4JError An error occurred
    while calling o26.isBarrier. Trace: py4j.Py4JException: Method
    isBarrier([]) does not exist   at
    py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318) 
    at
    py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326) 
    at py4j.Gateway.invoke(Gateway.java:274)   at
    py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)<br>
    at py4j.commands.CallCommand.execute(CallCommand.java:79)   at 
            from pyspark import SparkContext
            from pyspark import SparkConf</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>    conf = SparkConf()
  
      conf.setAppName("First App")
  
      sc = SparkContext('local',conf=conf)
      print("-----------------------------------------------------------------------------")
      lines = sc.textFile("sample.csv")
      print("-----------------------------------------------------------------------------")
      lines.count()
  </code></pre>