Flask-SQLAlchemy AttributeError: can't set attribute
Downgrading SQLAlchemy to anything lower than 1.4.0 (1.3.8 in my case) solves the problem.
AttributeError: can't set attribute when connecting to sqlite database with flask-sqlalchemy
Edit
If you're experiencing this, upgrading Flask-SQLAlchemy to >= 2.5 should resolve the issue per https://github.com/pallets/flask-sqlalchemy/issues/910#issuecomment-802098285.
Pinning SQLAlchemy to ~1.3 should no longer be necessary.
I ran into this issue a little earlier, but think I've figured out what's going on.
SQLAlchemy is automatically installed as a dependency for Flask-SQLAlchemy and its latest release (1.4.0) introduces the following breaking change:
The URL object is now an immutable named tuple. To modify a URL object, use the URL.set() method to produce a new URL object.
I was able to fix this issue by simply installing the previous version of SQL Alchemy (1.3.23).
Flask SQLAlchemy can't set attribute error in a venv
I recently delt with that same error message. It is actually due to an upgrade in SQLAlchemy, which gets installed as a dependency of flask-sqlalchemy.
You can find the question I posted on stackoverflow for the issue here:
The problem gets solved by uninstalling SQLAlchemy==1.4.0 and installing the previous version SQLAlchemy==1.3.23.
Try doing that in your virtual environ and see if it helps.
Flask SQLAlchemy db.create_all(app = app) can't set attribute
I have solved the problem by Downgrading the SQLAlchemy . For some reason the latest version is not working
pip install 'SQLAlchemy<1.4.0'
Related Topics
Convert Dictionary Entries into Variables
Find Substring in String But Only If Whole Words
Why Are Default Arguments Evaluated at Definition Time
How to Check Whether a Variable Is a Class or Not
Python Slice How-To, I Know the Python Slice But How to Use Built-In Slice Object for It
Attributeerror: Can't Set Attribute When Connecting to SQLite Database with Flask-Sqlalchemy
How to Remove Square Bracket from Pandas Dataframe
Pygame 2 Dimensional Movement of an Enemy Towards the Player, How to Calculate X and Y Velocity
Django JSONfield Inside Arrayfield
How to Replace Back Slash Character with Empty String in Python
How to Leave/Exit/Deactivate a Python Virtualenv
Xrange(2**100)' -> Overflowerror: Long Int Too Large to Convert to Int
Typeerror: Unhashable Type: 'List' When Using Built-In Set Function