jkehler/awslambda-psycopg2

No attribute 'paramstyle' error

Closed this issue · 1 comments

Using sqlalchemy 1.1.14 and psycopg2-3.6 package renamed as psycopg2 in aws lambda and keep seeing:

File "/var/task/sqlalchemy/engine/__init__.py", line 391, in create_engine
return strategy.create(*args, **kwargs)
File "/var/task/sqlalchemy/engine/strategies.py", line 88, in create
dialect = dialect_cls(**dialect_args)
File "/var/task/sqlalchemy/dialects/postgresql/psycopg2.py", line 521, in __init__
PGDialect.__init__(self, **kwargs)
File "/var/task/sqlalchemy/dialects/postgresql/base.py", line 2083, in __init__
default.DefaultDialect.__init__(self, **kwargs)
File "/var/task/sqlalchemy/engine/default.py", line 196, in __init__
self.paramstyle = self.dbapi.paramstyle
AttributeError: module 'psycopg2' has no attribute 'paramstyle'

I've tried using different versions of sqlalchemy with no luck.

Did you manage to resolve this issue? I've never come across it so i'm not sure what could be happening here.