windows7 + pycharm 搭建spark的python开发环境,Java gateway process exited before sending the driver its port

来源:互联网 发布:物流软件app是什么意思 编辑:程序博客网 时间:2024/06/06 04:53

spark版本spark-2.1.1-bin-hadoop2.7

jdk1.8

python 3.6


参考:http://www.jianshu.com/p/5701591bfc70


测试代码:

from pyspark import SparkContext, SparkConflogFile = 'C:\\Python\\Python36\\Lib\\site-packages\\README.txt'conf = SparkConf().setMaster("local[*]").setAppName("Fisrt")sc = SparkContext(conf=conf)logData = sc.textFile(logFile).cache()numAs = logData.filter(lambda s: 'a' in s).count()numBs = logData.filter(lambda s: 'b' in s).count()print('Lines with a :%i, lines with b: %i' % (numAs, numBs))


报错:Java gateway process exited before sending the driver its port number 

jdk安装到了C:\Program Files\Java下

重新卸载jdk,安装到C:\Java下。

猜测:jdk路径中有空格、特殊符号都会有问题。

阅读全文
0 1
原创粉丝点击