我已经为这个问题寻找了大约5个小时的解决方案,所以我对此感到非常恼火。
从本质上讲,我收到了一些警告:
WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
22/01/24 00:20:03 WARN SparkContext: Another SparkContext is being constructed (or threw an exception in its constructor). This may indicate an error, since only one SparkContext should be running in this JVM (see SPARK-2243). The other SparkContext was created at:
在我的系统变量中,我有:
HADOOP_HOME
C:\spark-3.2.0-bin-hadoop3.2
SPARK_HOME
C:\spark-3.2.0-bin-hadoop3.2
JAVA_HOME
C:\Program Files\Java\jdk-17.0.1
在系统变量路径中,我有%SPARK_HOME%\bin
。我在C:\spark-3.2.0-bin-hadoop3.2\bin
中也有winutils,这是应该的。命令提示符上的pyspark命令应该可以工作,但是计算机一直给出错误,我将在下面复制。提前感谢你的帮助,因为我知道类似的问题已经被回答了,但是当我尝试那些其他的答案时,我总是会犯错误。不太清楚发生了什么事..。
UserWarning: Failed to initialize Spark session.
warnings.warn("Failed to initialize Spark session.")
和死亡之吻
SUCCESS: The process with PID 33244 (child process of PID 12556) has been terminated.
SUCCESS: The process with PID 12556 (child process of PID 13404) has been terminated.
发布于 2022-01-24 06:19:45
您需要使用hadoop主文件夹中的winutils.exe才能工作。
发布于 2022-01-24 09:26:49
根据您的输入,可能会进行其他检查:
PYSPARK_PYTHON="C:\Users\AppData\Local\Continuum\anaconda3\envs\spark\python.exe"
https://stackoverflow.com/questions/70829395
复制相似问题