简体   繁体   English

与Postgresql链接后,Airflow initdb命令失败

[英]Airflow initdb command fails after linking with postgresql

I am trying to connect Airflow with a Postgresql DB. 我正在尝试将Airflow与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. airflow.cfg我改变sql_alchemy_conn = spostgresql+psycopg2://127.0.0.1:5432/airflow ,其中airflow是我的数据库是安装在同一台机器上的名称。

After updating the config file, I run airflow initdb and get the following error which I cannot understand: 更新配置文件后,我运行airflow initdb并收到以下我无法理解的错误:

  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 ). 在我看来,您的sqlalchemy连接字符串(在postgres开头的s中有一个错字。 Try changing: 尝试改变:

spostgresql+psycopg2://127.0.0.1:5432/airflow

to

postgresql+psycopg2://127.0.0.1:5432/airflow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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