PySpark kann in Google Colab nicht ausgeführt werdenPython

Python-Programme
Anonymous
 PySpark kann in Google Colab nicht ausgeführt werden

Post by Anonymous »

Hallo, ich versuche, PySpark auf Google Colab mit folgendem Code auszuführen:

Code: Select all

!apt-get install openjdk-8-jdk-headless -qq > /dev/null
!wget -q http://apache.osuosl.org/spark/spark-2.4.5/spark-2.4.5-bin-hadoop2.7.tgz
!tar xf spark-2.4.5-bin-hadoop2.7.tgz
!pip install -q findspark

Code: Select all

import os
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-8-openjdk-amd64"
os.environ["SPARK_HOME"] = "/content/spark-2.4.5-bin-hadoop2.7"

Code: Select all

import findspark
findspark.init()
from pyspark.sql import SparkSession
spark = SparkSession.builder.master("local[*]").getOrCreate()
Ich erhalte folgende Fehlermeldung:

Code: Select all

/content/spark-2.4.5-bin-hadoop2.7/python/pyspark/java_gateway.py in _launch_gateway(conf, insecure)
106
107             if not os.path.isfile(conn_info_file):
--> 108                 raise Exception("Java gateway process exited before sending its port number")
109
110             with open(conn_info_file, "rb") as info:

Exception: Java gateway process exited before sending its port number
HINWEIS: Ich konnte diesen Code bis heute Nachmittag ausführen, plötzlich trat dieser Fehler am Abend auf

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post