由于配置了JAVA_HOME的路径中有空格所以导致pyspark不能访问
解决办法
Program Files转换为Progra~1
有的建议用双引号把有空格的路径括起来
Program Files->"Program Files" 测试没有起作用
在pyspark不能使用的时候,提示的信息往往不是很明显:
D:\Python\test>python WordCount2.py
此时不应有 Files"\Java\jdk1.8.0_231"=="x"。
Traceback (most recent call last):
File "WordCount2.py", line 6, in <module>
sc = SparkContext(conf=conf)
File "D:\Python\Python38\lib\site-packages\pyspark\context.py", line 128, in __init__
SparkContext._ensure_initialized(self, gateway=gateway, conf=conf)
File "D:\Python\Python38\lib\site-packages\pyspark\context.py", line 320, in _ensure_initialized
SparkContext._gateway = gateway or launch_gateway(conf)
File "D:\Python\Python38\lib\site-packages\pyspark\java_gateway.py", line 105, in launch_gateway
raise Exception("Java gateway process exited before sending its port number")
Exception: Java gateway process exited before sending its port number
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/140791.html