Impossible to connect to bucket

250 views
Skip to first unread message

Jerome Massot

unread,
May 29, 2019, 10:33:16 PM5/29/19
to Google App Engine
Hi all,

I have the following annoying problem. It appears today... but I have run this snippet thousands of time without any issue :(

# export the key location into the system path
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "key.json"

bucket = storage.Client().get_bucket(
args['bucket_id']
)

and the run returns:

Traceback (most recent call last): File "labelled_sentence_generator.py", line 223, in <module> bucket = storage.Client().get_bucket( File "/usr/local/lib/python2.7/dist-packages/google/cloud/storage/client.py", line 86, in __init__ self._connection = Connection(self, client_info=client_info) File "/usr/local/lib/python2.7/dist-packages/google/cloud/storage/_http.py", line 33, in __init__ super(Connection, self).__init__(client, client_info)TypeError: __init__() takes exactly 2 arguments (3 given)

Thanks for any help :)

Best regards

Jerome

Víctor Arroyo Martínez

unread,
May 30, 2019, 12:13:55 PM5/30/19
to Google App Engine
Hi!

I have just had the same issue in my conda environment In Windows. 

It is a mismatch of google python packages I had, using google-cloud-storage 1.16.0 with some outdated google packages.
I assume that the main mismatch was with google-cloud-core that was in version 0.29.1.

I have updated to google-cloud-core-1.0.0 and google-api-core-1.11.0 and the issue is solved.

Now the Connection base class (in google/cloud/_http) accepts the ClientInfo argument.

Hope it helps!!

BR, Víctor
Reply all
Reply to author
Forward
0 new messages