Python使用spark时出現版本不同的错误

来源:互联网 发布:惠州狼雨seo 编辑:程序博客网 时间:2024/05/16 14:19

异常描述:

Exception: Python in worker has different version 2.7 than that in driver 3.4, PySpark cannot run with different minor versions.Please check environment variables PYSPARK_PYTHON and PYSPARK_DRIVER_PYTHON are correctly set.

问题解决:

import osos.environ["PYSPARK_PYTHON"]="/usr/bin/python3"

指向想要的python版本的路径即可

原创粉丝点击