How do I set the driver's python version in spark?



You need to make sure the standalone project you're launching is launched with python 3. If your are submitting your standalone program through spark-submit then it should work fine, but if you are launching it with python make sure you use python3 to start your app.

Also make sure you have set your env variables in ./conf/spark-spark-env.sh (if it doesnt exist you can use spark-env.sh.template as a base.


 
2 
@Kevin - I am having same problem, could you please post your solution regarding what change you made in spark-evn.sh. –  Dev Patel Jun 22 '15 at 17:14
1 
This is the right way of inducing PATH variables to Spark, instead of modifying .bashrc. –  CᴴᴀZ Aug 3 at 12:31
   
Why is using python 3 required @Holden? –  jerzy Aug 17 at 19:44
   
Spark can run in python2, but in this case the user was trying to specify python3 in their question. Whichever Python version it is it needs to be done consistently. –  Holden Aug 26 at 9:45



Setting PYSPARK_PYTHON=python3 and PYSPARK_DRIVER_PYTHON=python3 both to python3 works for me. I did this using export in my .bashrc. In the end, these are the variables I create:

export SPARK_HOME="$HOME/Downloads/spark-1.4.0-bin-hadoop2.4"
export IPYTHON=1
export PYSPARK_PYTHON=/usr/bin/python3
export PYSPARK_DRIVER_PYTHON=ipython3
export PYSPARK_DRIVER_PYTHON_OPTS="notebook"
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值