title: pyspark throws TypeError: textFile() missing 1 required positional argument: 'name'
body: <p>I googled this problem, yet no direct answer related to spark-2.2.0-bin-hadoop2.7. I am trying to read a text file from local directory, but I always get TypeError that <code>name</code> argument is missing. This is the code in jupyter notebook with Python3: </p>
  
  <pre><code>from pyspark import SparkContext as sc
  data = sc.textFile("/home/bigdata/test.txt")
  </code></pre>
  
  <p>When I run the cell, I get this error:</p>
  
  <pre><code>TypeError                                 Traceback (most recent call last)
    &lt;ipython-input-7-2a326e5b8f8c&gt; in &lt;module&gt;()
    1 from pyspark import SparkContext as sc
    ----&gt; 2 data = sc.textFile("/home/bigdata/test.txt")
    TypeError: textFile() missing 1 required positional argument: 'name'
  </code></pre>
  
  <p>Your help is appreciated.</p>