首页 > 解决方案 > 使用 Python 3 运行 Apache Beam v 2.2.5 时,我应该使用哪个版本的 dill?

问题描述

我正在尝试使用 Apache Beam v 2.25 和 Python 3.7 运行数据流作业。使用 DirectRunner 时一切正常,但当它尝试从另一个私有 Python 模块调用函数时,作业出错。

错误是

AttributeError: Can't get attribute '_create_code' on <module 'dill._dill' from '/usr/local/lib/python3.7/site-packages/dill/_dill.py'>

我的设置文件如下所示:

setup(
name="Rich Profile and Activiation reports",
version="0.1",
description="Scripts for reports",
author="Kim Merino",
install_requires=REQUIRED_PACKAGES,
packages=setuptools.find_packages(),
include_package_data=True,
package_data={"": ["*.json"]},

)

我的问题是我应该为 Apache Beam v. 2.25 使用哪个版本的 dill?我目前正在使用 Dill v 0.3.3

我有一个外部依赖项,需要莳萝才能工作

标签: python-3.xgoogle-cloud-platformgoogle-cloud-dataflowapache-beamdill

解决方案


你试过--save_main_session=True在运行管道时设置吗?

https://cloud.google.com/dataflow/docs/resources/faq#how_do_i_handle_nameerrors


推荐阅读