运行代码
1 | # pyspark |
报错
1 | Python in worker has different version 2.6 than that in driver 2.7, PySpark cannot run with different minor versions |
原因
- pytspark 启动时使用的是python2.7
- 内部脚本设置的PYSPARK_PYTHON 是python2.6
解决
增加 config/spark-env.sh 配置1
PYSPARK_PYTHON=/usr/local/bin/python