pyspark - name spark is not defined -
trying follow spark tutorial following error -
https://spark.apache.org/docs/latest/quick-start.html
"name 'spark' not defined"
using python version 2.6.6 (r266:84292, nov 22 2013 12:16:22) sparkcontext available sc. >>> import pyspark >>> textfile = spark.read.text("readme.md") traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'spark' not defined this how start -
./bin/pyspark --master local[*]
if spark version 1.0.1 should not use tutorial version 2.2.0. there major changes between these versions.
on website can find tutorial 1.6.0 .
following 1.6.0 tutorial have use textfile = sc.textfile("readme.md") instead of textfile = spark.read.text("readme.md").
Comments
Post a Comment