codemation / easyauth

Create a centralized Authentication and Authorization token server. Easily secure FastAPI endpoints based on Users, Groups, Roles or Permissions with very little database usage.
https://easyauth.readthedocs.io/en/latest/
MIT License
542 stars 50 forks source link

Can't load plugin: sqlalchemy.dialects:postgres #81

Open abduistheusername opened 1 year ago

abduistheusername commented 1 year ago

How can i override this issue?

File "C:\Users\PC\codmeric\test_prject\venv\lib\site-packages\sqlalchemy\util\langhelpers.py", line 343, in load raise exc.NoSuchModuleError( sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:postgres

codemation commented 1 year ago

@abduistheusername , it looks like the db URL contains postgres, but the library required for postgres may not be installed? Does the error not suggest a missing library?

remydewa commented 1 year ago

hello @abduistheusername, I think it will resolve your issue:

SQLAlchemy 1.4 removed the deprecated postgres dialect name, the name postgresql must be used instead now. The dialect is the part before the :// in the URL. SQLAlchemy 1.3 and earlier showed a deprecation warning but still accepted it.

So in your json config file change DB_TYPE from postgres to postgresql

It worked for me.

Rémy