I have files in a Storage Bucket that I can't access from python using the Cloud Shell. I created this simple example:
open('gs://iwc/panda.jpg')
which results in this:
jklieb@cloudshell:~$ python demo.py
Traceback (most recent call last):
File "demo.py", line 1, in <module>
open('gs://iwc/panda.jpg')
IOError: [Errno 2] No such file or directory: 'gs://iwc/panda.jpg'
But the file is visible when using gsutil:
jklieb@cloudshell:~$ gsutil ls gs://iwc
gs://iwc/panda.jpg
I created a separate virtual machine instance (not the temporary one associated with Cloud Shell) and had a similar result.
I have also provisioned a TPU using ctpu and was similarly unable to access files in another storage bucket. The documentation on ctpu says that the permissions should be properly set up to allow access to storage buckets.
Have I made some simple mistake that is too obvious for me to see?