我正在尝试使用python代码读取Google Cloud Storage存储桶中的文件但是收到错误

问题描述 投票:-1回答:1

我正在尝试读取存储在Google Cloud Storage存储桶python中的文件:

textfile = open("${gcs_bucket}mdm/OFF-B/test.txt", 'r') 
times = textfile.read().splitlines() 
textfile.close() 
print(getcwd()) 
print(times)

该文件存在于该位置,但我收到以下错误:

File "/var/cache/tomcat/temp/interpreter-9196592956267519250.tmp", line 3, in <module>
  textfile = open("gs://tp-bi-datalake-mft-landing-dev/mdm/OFF-B/test.txt", 'r')
IOError: [Errno 2] No such file or directory: 'gs://tp-bi-datalake-mft-landing-dev/mdm/OFF-B/test.txt'
python-3.x google-cloud-platform jython matillion
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.