1、环境配置教程:地址
2、测试代码示例
import os import findspark os.environ['JAVA_HOME'] = 'D:\Java\jdk1.8.0_311' # 这里的路径为java的bin目录所在路径 spark_home = "D:\spark-3.0.3-bin-hadoop2.7" python_path = "D:\Anaconda3\bin\python" findspark.init(spark_home) import pyspark from pyspark.sql import SparkSession #SparkSQL的许多功能封装在SparkSession的方法接口中 spark = SparkSession.builder \ .appName("test") \ .config("master","local[*]") \ .enableHiveSupport() \ .getOrCreate() sc = spark.sparkContext
标签:bin,pyspark,SparkSession,home,win10,import,spark,搭建 From: https://www.cnblogs.com/cupleo/p/pyspark.html