简体   繁体   English

pyspark:Configparser 未从谷歌存储读取配置文件

[英]pyspark : Configparser is not reading config file from google storage

I am trying to read a config file from google storage bucket via pyspark script run by dataproc.我正在尝试通过 dataproc 运行的 pyspark 脚本从谷歌存储桶中读取配置文件。 But the file is not read.但是文件没有被读取。

config = configparser.ConfigParser()
config.read('gs://<<google_bucket_location>>/example.ini')
[]

Notice that configparser reads only local files.请注意,configparser 只读取本地文件。 The best option is to download the config file from GCS into a tmp directory and read it form there.最好的选择是将配置文件从 GCS 下载到 tmp 目录并从那里读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM