I'm running a generic (because I don't know enough to do anything beyond the basics) Flask-SQLAlchemy 3.0.2 setup on Python 3.10.
Not sure what happened, but at some point it started throwing this error every time I tried to query the db:
AttributeError: module 'psycopg2' has no attribute 'paramstyle'
I'm doing package management through poetry and SQLAlchemy 1.4.44 really wanted to use psycopg2 2.7, which I guess pre-dates paramstyle.
I uninstalled psycopg2 (and removed its requirement from the poetry lock file), and installed psycopg2-binary 2.9.5 manually. Now it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With