Airflow initdb command fails after linking with postgresql

时间:2019-03-17 22:38:43

标签: database postgresql airflow

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?

1 个答案:

答案 0 :(得分:0)

在我看来,您的sqlalchemy连接字符串(在PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings 开头的s中有一个错字)。尝试更改:

postgres

spostgresql+psycopg2://127.0.0.1:5432/airflow