简体   繁体   中英

Airflow initdb command fails after linking with postgresql

I am trying to connect Airflow with a Postgresql DB.

When in airflow.cfg I change the sql_alchemy_conn = spostgresql+psycopg2://127.0.0.1:5432/airflow , where airflow is the name of my DB which is installed on the same machine.

After updating the config file, I run airflow initdb and get the following error which I cannot understand:

  File "/some_path/env/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 232, in load
    "Can't load plugin: %s:%s" % (self.group, name)
sqlalchemy.exc.NoSuchModuleError: Can't load plugin: sqlalchemy.dialects:spostgresql.psycopg2

I found this on the web, which seems to "solve" this problem, but the solution was not clear to me at all.

Can someone tell me what the problem is and how to solve it?

Looks to me like you have a typo in your sqlalchemy connection string ( s at the beginning of postgres ). Try changing:

spostgresql+psycopg2://127.0.0.1:5432/airflow

to

postgresql+psycopg2://127.0.0.1:5432/airflow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM