You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

EMR集群中PySpark代码读取YAML文件出现路径不存在错误的排查求助

EMR集群中PySpark代码读取YAML文件出现路径不存在错误的排查求助

我在EMR集群上运行PySpark代码,需要读取一个YAML配置文件,但一直碰到「路径不存在」的错误,折腾了两种方式都没解决,想请教大家该从哪些方面排查?

我使用的spark-submit命令如下:

spark-submit --deploy-mode client --executor-memory 20G --num-executors 4 --executor-cores 4 --jars s3://stage/jdbc_driver/ojdbc8.jar --files s3://rxl-dev-stage/etl_script/constants.yml s3://stage/etl_script/main.py

首先尝试了直接用文件名读取:

with open("constants.yml","r") as f:
    constants=yaml.safe_load(f)

后来查资料以为通过--files参数上传的文件会被放到/mnt/spark/work/files/目录下,又试了绝对路径:

with open("/mnt/spark/work/files/constants.yml","r") as f:
     constants=yaml.safe_load(f)

但两种方式都抛出了「该路径不存在」的错误,有没有大佬能指点下我该从哪些方向去排查这个问题?谢谢!

备注:内容来源于stack exchange,提问作者Vishal Prajapati

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.20 02:44:30