【发布时间】:2019-09-18 04:22:36
【问题描述】:
我正在尝试读取存储在 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'
【问题讨论】:
-
textfile = open("${gcs_bucket}mdm/OFF-B/test.txt", 'r') times = textfile.read().splitlines() textfile.close() print( getcwd()) print(times) 是我的代码
-
不要将此放在评论中。把它放在你的问题中。
标签: python-3.x google-cloud-platform jython matillion