2017-01-31 3 views
0

Ich habe Funken für pyspark installieren Sie das Verfahren in diesem Link erwähnt mit ..SparkContext nicht auf Windows7 gefunden

http://nishutayaltech.blogspot.in/2015/04/how-to-run-apache-spark-on-windows7-in.html

Jetzt habe ich pyspark erschaffe und zu versuchen, verwenden „sc“ variable.But ich immer bin unter Fehler.

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
NameError: name 'sc' is not defined 

ich unter Variablen versucht

from pyspark import SparkContext 
SparkContext.setSystemProperty('spark.executor.memory', '2g') 
sc = SparkContext("local", "App Name") 

der Fehler ich bin immer ist:

Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "D:\BIGDATA\spark-2.1.0-bin-hadoop2.7\python\pyspark\context.py", line 115, in __init__ 
    SparkContext._ensure_initialized(self, gateway=gateway, conf=conf) 
    File "D:\BIGDATA\spark-2.1.0-bin-hadoop2.7\python\pyspark\context.py", line 272, in _ensure_initialized 
    callsite.function, callsite.file, callsite.linenum)) 
ValueError: Cannot run multiple SparkContexts at once; existing SparkContext(app=PySparkShell, master=local[*]) created by getOrCreate at D:\BIGDATA\spark-2.1.0-bin-hadoop2.7\bin\..\python\pyspark\shell.py:43 

Antwort

0

In Bezug auf die folgenden Fehler:

ValueError: Cannot run multiple SparkContexts at once; existing SparkContext(app=PySparkShell, master=local[*]) created by getOrCreate at D:\BIGDATA\spark-2.1.0-bin-hadoop2.7\bin..\python\pyspark\shell.py:43

Die Quelle dieses Fehlers scheint eine vorherigezu sein, die nicht gestoppt wurde.

Das Ausführen von sc.stop() vor dem Versuch, ein weiteres SparkContext zu erstellen, sollte den multiple SparkContexts Fehler beheben.

Einige zusätzliche Links für Funke auf die Installation von Windows (aus meiner Erfahrung einige Anweisungen einige Details fehlen):

Verwandte Themen