Hello.
I have been confronted with `TypeError' in trying 'storage.Client()' on Google App Engine (Python3.7 standard environment).
The cord was like this:
import flask
from google.cloud import storage
app = flask.Flask(__name__)
@app.route('/storage_test', method = ['POST'])
def storage_test():
client = storage.Client()
I pushed this app with gcloud app deploy command, and send post request to the proper URL.
Then, I faced the following error:
TypeError: __init__() takes 2 positional arguments but 3 were given
at __init__ (/env/lib/python3.7/site-packages/google/cloud/storage/_http.py:35)
at __init__ (/env/lib/python3.7/site-packages/google/cloud/storage/client.py:110)
at storage_test (/srv/main.py:7)
Though I tried to downgrade to google-cloud-storage==1.18.0, it didn't work either.
I would appreciate it if you give us some reply.
My requirements.txt is like this:
Flask==1.1.1
Werkzeug==0.15.5
google-cloud-storage==1.19.0
You have an out-of-date version of google-cloud-core installed somehow. google-cloud-storage 1.19.0 requires google-cloud-core >= 1.0.3, while google-cloud-storage 1.18.0 requires google-cloud-core >= 1.0.0.
The Python3 AppEngine docs recommend using pip freeze in your local virtual environment to generate requirements.txt, which suggests to me that the installation process doesn't actually resolve dependencies.
Most helpful comment
You have an out-of-date version of
google-cloud-coreinstalled somehow.google-cloud-storage 1.19.0requiresgoogle-cloud-core >= 1.0.3, whilegoogle-cloud-storage 1.18.0requiresgoogle-cloud-core >= 1.0.0.The Python3 AppEngine docs recommend using
pip freezein your local virtual environment to generaterequirements.txt, which suggests to me that the installation process doesn't actually resolve dependencies.