I have a similar issues like How to upload a bytes image on Google Cloud Storage from a Python script.
I tried this
from google.cloud import storage
imp
You are calling blob = bucket.get_blob(gcs_image)
which makes no sense. get_blob()
is supposed to get a string argument, namely the name of the blob you want to get. A name. But you pass a file object.
I propose this code:
with TemporaryFile() as gcs_image:
image.tofile(gcs_image)
gcs_image.seek(0)
blob = bucket.blob('documentation-screenshots/operations/15.png')
blob.upload_from_file(gcs_image)