Marghoob Kaify
Marghoob Kaify

Reputation: 11

How to fix error "File "/.../google/cloud/storage/_http.py", line 33, in __init__ TypeError: __init__() takes 2 positional arguments but 3 were given"

The above mentioned error occurred while trying to run a cloud function in Google Cloud Platform. The error occurred in its main.py written in python in the line "storage_client=storage.Client()"

I have also checked the github repository for google-cloud-python/storage/google/cloud/storage/_http.py line 33 where it is showing error but I have done nothing with those variables anywhere, I reckon

Any help will be appreciated

Upvotes: 1

Views: 384

Answers (1)

bioin4
bioin4

Reputation: 614

I just experienced this same issue--

Short answer-- upgrade the google-cloud-core package: e.g. in my case I had google-cloud-core==0.29.1

Upgrading to version 1.0.2 solved my issue:

pip3 install --upgrade google-cloud-core==1.0.2

For me, this arose from installing all my python packages from a requirements.txt file, which had explicit versions. Sometime later, I must have upgraded and the packages did not stay aligned.

Upvotes: 2

Related Questions