Śledzę jakiś poradnik, ale one nie działają z Spark 1.5.1
na OS X El Capitan (10,11)link Spark z ipython Notebook
Zasadniczo mam uruchomić to polecenie Pobierz apache-spark
brew update
brew install scala
brew install apache-spark
aktualizowana .bash_profile
# For a ipython notebook and pyspark integration
if which pyspark > /dev/null; then
export SPARK_HOME="/usr/local/Cellar/apache-spark/1.5.1/libexec/"
export PYSPARK_SUBMIT_ARGS="--master local[2]"
fi
run
ipython profile create pyspark
utworzony plik startowy ~/.ipython/profile_pyspark/startup/00-pyspark-setup.py
skonfigurowany w ten sposób
# Configure the necessary Spark environment
import os
import sys
# Spark home
spark_home = os.environ.get("SPARK_HOME")
# If Spark V1.4.x is detected, then add ' pyspark-shell' to
# the end of the 'PYSPARK_SUBMIT_ARGS' environment variable
spark_release_file = spark_home + "/RELEASE"
if os.path.exists(spark_release_file) and "Spark 1.4" in open(spark_release_file).read():
pyspark_submit_args = os.environ.get("PYSPARK_SUBMIT_ARGS", "")
if not "pyspark-shell" in pyspark_submit_args: pyspark_submit_args += " pyspark-shell"
os.environ["PYSPARK_SUBMIT_ARGS"] = pyspark_submit_args
# Add the spark python sub-directory to the path
sys.path.insert(0, spark_home + "/python")
# Add the py4j to the path.
# You may need to change the version number to match your install
sys.path.insert(0, os.path.join(spark_home, "python/lib/py4j-0.8.2.1-src.zip"))
# Initialize PySpark to predefine the SparkContext variable 'sc'
execfile(os.path.join(spark_home, "python/pyspark/shell.py"))
I następnie uruchomić ipython notebook --profile=pyspark
a komputer działa bez zarzutu, ale sc
(kontekst iskra) nie jest rozpoznawane.
Ktoś zdążył to zrobić z Spark 1.5.1
?
EDIT: można śledzić ten przewodnik, aby mieć to działa
https://gist.github.com/tommycarpi/f5a67c66a8f2170e263c
Witam, mam ten sam problem i nadal nie można rozwiązać. Używam OS X Elcapitab, Jupiter, iskra 1.5.2. Jakie (dodatkowe) rzeczy zrobiliście, aby działało "sc"? – user1717931
Po rozwiązaniu wszystkich problemów napisałem ten samouczek https://gist.github.com/tommycarpi/f5a67c66a8f2170e263c. Spójrz na to, użyłem tych dokładnych kroków i to działa dobrze. Mam nadzieję że to pomoże. – r4id4