spark-submit提交python任务,使用指定的python环境

参考spark Configuration,有如下描述:

配置描述
spark.pyspark.driver.pythonPython binary executable to use for PySpark in driver. (default is spark.pyspark.python)
spark.pyspark.pythonPython binary executable to use for PySpark in both driver and executors.

使用--conf指定python环境:

--conf "spark.pyspark.driver.python=/path/to/envs/bin/python3.7" \
--conf "spark.pyspark.python=/path/to/envs/bin/python3.7" \

根据描述,为了保证驱动器和执行器的python环境一致,只指定 spark.pyspark.python即可。

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐