java.io.IOException: Cannot run program “/usr/local/python3“: error=13, 权限不够
程序员文章站
2022-05-13 20:03:21
...
0 错误复现
Exception in task 0.0 in stage 45.0 (TID 4423) java.io.IOException: Cannot run program "/usr/local/python3": error=13, 权限不够
1 解决办法
在环境变量中配置Python解释器的路径:
export PYSPARK_PYTHON=/usr/local/python3/bin/python3
或者使用findspark:
# coding=utf-8
#### spark环境
import findspark
findspark.add_jars("/usr/app/hudi-0.8.0/docker/hoodie/hadoop/hive_base/target/hoodie-spark-bundle.jar")
findspark.add_packages("org.apache.spark:spark-avro_2.11:2.4.4")
findspark._add_to_submit_args("--driver-class-path /usr/app/hadoop-2.10.1/etc/hadoop:/usr/app/apache-hive-2.3.8-bin/conf/:/software/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar")
findspark.init(spark_home="/usr/app/spark-2.4.7-bin-hadoop2.7", python_path="/usr/bin/python3")
上一篇: 07. 组件映射