client = storage.Client()
blob = Blob.from_string("gs://current-project/images/myimage.jpeg")
print(blob.bucket.name)
fileName = blob.name.split('/')[-1]
print(fileName)
print(blob)
blob.download_to_filename('test1.jpeg')
I am able to print the bucket name, blob info and fileName as well. But when I try to download the image it gives me an error.
AttributeError: 'NoneType' object has no attribute '_connection'
I am not sure what I am missing. If I use this link to download the image and explicitly specify the bucket name and create blob object from bucket it works fine. I am not understanding the error.