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
方法二:
这样设置也是可以的