TypeError: __init__() got an unexpected keyword argument ‘as_tuple’

We Are Going To Discuss About TypeError: __init__() got an unexpected keyword argument ‘as_tuple’. So lets Start this Python Article.

TypeError: __init__() got an unexpected keyword argument ‘as_tuple’

Advertisements
  1. How to solve TypeError: __init__() got an unexpected keyword argument 'as_tuple'

    As of version 2.1.0, werkzeug has removed the as_tuple argument to Client. Since Flask wraps werkzeug and you're using a version that still passes this argument, it will fail. See the exact change on the GitHub PR here.
    You can take one of two paths to solve this:
    Upgrade flask
    Pin your werkzeug version
    # in requirements.txt werkzeug==2.0.3

  2. TypeError: __init__() got an unexpected keyword argument 'as_tuple'

    As of version 2.1.0, werkzeug has removed the as_tuple argument to Client. Since Flask wraps werkzeug and you're using a version that still passes this argument, it will fail. See the exact change on the GitHub PR here.
    You can take one of two paths to solve this:
    Upgrade flask
    Pin your werkzeug version
    # in requirements.txt werkzeug==2.0.3

Solution 1

Advertisements

As of version 2.1.0, werkzeug has removed the as_tuple argument to Client. Since Flask wraps werkzeug and you’re using a version that still passes this argument, it will fail. See the exact change on the GitHub PR here.

You can take one of two paths to solve this:

  1. Upgrade flask

  2. Pin your werkzeug version

# in requirements.txt
werkzeug==2.0.3

Original Author Christian Di Lorenzo Of This Content

Solution 2

Advertisements

Adding to Christian Di Lorenzo’s answer

  1. Upgrade flask
# in requirements.txt
Flask==2.1.1
  1. Pin your werkzeug version
# in requirements.txt
werkzeug==2.0.3

Original Author Shalin Hudda Of This Content

Conclusion

Advertisements

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Advertisements
ittutorial team

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment