spark之pycharm开发设置

方法一:

__author__ = 'similarface'
import os
import sys
os.environ['SPARK_HOME']="/Users/similarface/spark-1.6.0-bin-hadoop2.6"
sys.path.append("/Users/similarface/spark-1.6.0-bin-hadoop2.6/python")

try:
    from pyspark import SparkContext,SparkConf
    print("Successfully imported Spark Modules")
except ImportError as e:
    print("Can not import Spark Modules", e)
    sys.exit(1)

#result:

Successfully imported Spark Modules

方法二:

 

 这样设置也是可以的

posted @ 2016-04-25 17:08  similarface  阅读(3437)  评论(0编辑  收藏  举报