kenn
May 9, 2023, 3:42am
1
I’m getting this error from SQLAlchemy:
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres
turns out, the DB URL generated by Render is an obsolete one — now postgres:
is deprecated, and should use postgresql:
instead.
Context: python - sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres - Stack Overflow
Will you fix this soon?
al_ps
May 9, 2023, 9:34am
2
Hi,
Thanks for reaching out.
SQLAlchemy is one of the only Postgres clients that enforces the postgresql://
scheme, most others will accept it along with postgres://
. libpq
of Postgres itself also accepts both (docs )
This is discussed at length in a GitHub issue here: https://github.com/sqlalchemy/sqlalchemy/issues/6083
A couple of workarounds could be:
If you’re setting a database URL on your service manually, amend the scheme to postgresql://
when creating the env var.
Or, of you’re getting a database env var setup via a Blueprint, then a small check in code may help, as suggested in the GitHub issue above .
However, I’ll raise this with the Datastores team.
Kind regards
Alan
kenn
May 9, 2023, 12:54pm
3
Hi Alan,
Thanks for your response!
Actually, I faced the same problem the second time today with Retool , a trending Admin-as-a-Service app.
They take the DB URL string, and postgres:
scheme failed, while manually modifying it to postgresql:
worked.
So it’s not just SQLAlchemy, it’s more than that. I’m not sure if it’s a good trade-off worth saving 2 characters?
al_ps
May 9, 2023, 2:14pm
4
Thanks for pointing out another case, however, I didn’t say SQLAlchemy was the only example. I’ll still be running this past our engineers, until then, you’ll need to add the ql
manually.
Alan
system
Closed
June 8, 2023, 12:55pm
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.