I see several post that contain the same error as the error that I am receiving, but none are leading me to a fix on my code. I have used this exact same code many times with no issue and now am having problems. Here is the error I receive:
y4j.protocol.Py4JJavaError: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext.
: org.apache.spark.SparkException: Only one SparkContext may be running in this JVM (see SPARK-2243).
Here is how I start my context within my python script:
spark = ps.sql.SparkSession.builder
.master("local[*]")
.appName("collab_rec")
.config("spark.mongodb.input.uri", "mongodb://127.0.0.1/bgg.game_commen$
.getOrCreate()
sc = spark.sparkContext
sc.setCheckpointDir('checkpoint/')
sqlContext = SQLContext(spark)
Please let me know if you have a suggestion.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…