ModuleNotFoundError: No module named 'psycopg2' - Dataflow
ModuleNotFoundError: No module named 'psycopg2' - Dataflow
我一直在 Whosebug 上冲浪寻找解决这个问题的方法:
我尝试了不同的方法,不幸的是我没有解决它。
场景:
我有一个 python 脚本,它通过 Apache Beam 从 Google Pubsub 读取消息。
每收到一条消息,我都会调用一个插入 PostgreSQL table:
的过程
我的方法使用 psycopg2 连接调用 PostgreSQL 存储过程:
运行 我在 DirectRunner 上的代码,运行良好。当我 运行 它在数据流上时,我收到消息:
ModuleNotFoundError: 没有名为 'psycopg2'.
的模块
有人可以帮帮我吗?
谢谢,
朱利安诺
Dataflow runner is a temporary cluster in Google Cloud Platform. Dataflow runner does not have your local libraries. You need to specify --requirements_file requirements.txt
当您 运行 您的数据流时在命令行上。
我一直在 Whosebug 上冲浪寻找解决这个问题的方法:
我尝试了不同的方法,不幸的是我没有解决它。
场景:
我有一个 python 脚本,它通过 Apache Beam 从 Google Pubsub 读取消息。 每收到一条消息,我都会调用一个插入 PostgreSQL table:
的过程我的方法使用 psycopg2 连接调用 PostgreSQL 存储过程:
运行 我在 DirectRunner 上的代码,运行良好。当我 运行 它在数据流上时,我收到消息:
ModuleNotFoundError: 没有名为 'psycopg2'.
的模块有人可以帮帮我吗?
谢谢, 朱利安诺
Dataflow runner is a temporary cluster in Google Cloud Platform. Dataflow runner does not have your local libraries. You need to specify --requirements_file requirements.txt
当您 运行 您的数据流时在命令行上。