0

我在 Dataflow 中执行 Apache Beam 管道时遇到问题(使用 DirectRunner)。我有一个requirements.txt文件,其中包含 apache-beam[gcp] 以及其他库。

以下是错误 TraceBack:

2021-08-04 12:08:24.574 | INFO     | apache_beam.runners.portability.stager:_populate_requirements_cache:646 - Executing command: ['/usr/bin/python3', '-m', 'pip', 'download', '--dest', '/tmp/dataflow-requirements-cache', '-r', '$PATH/requirements.txt', '--exists-action', 'i', '--no-binary', ':all:']

2021-08-04 12:09:04.694 | ERROR    | main:process:102 - An error has been caught in function 'process', process 'MainProcess' (13060), thread 'Thread-4' (140614797276928):

最后,我收到以下错误:

WARNING: Discarding https://files.pythonhosted.org/packages/f1/23/62d3e82fa4c505f3195315c8a774b2e656b556d174329aa98edb829e48bc/grpcio-1.29.0.tar.gz#sha256=a97ea91e31863c9a3879684b5fb3c6ab4b17c5431787548fc9f52b9483ea9c25 (from https://pypi.org/simple/grpcio/). 
Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement grpcio<2,>=1.29.0 (from apache-beam[gcp]) (from versions: 0.4.0a0, 0.4.0a1, 0.4.0a2, 0.4.0a3, 0.4.0a4, 0.4.0a5, 0.4.0a6, 0.4.0a7, 0.4.0a8, 0.4.0a13, 0.4.0a14, 0.5.0a0, 0.5.0a1, 0.5.0a2, 0.9.0a0, 0.9.0a1, 0.10.0a0, 0.11.0b0, 0.11.0b1, 0.12.0b0, 0.13.0, 0.13.1rc1, 0.13.1, 0.14.0rc1, 0.14.0, 0.15.0, 1.0.0rc1, 1.0.0rc2, 1.0.0, 1.0.1rc1, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.3, 1.2.0, 1.2.1, 1.3.0, 1.3.5, 1.4.0, 1.6.0, 1.6.3, 1.7.0, 1.7.3, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.6, 1.9.0rc1, 1.9.0rc2, 1.9.0rc3, 1.9.0, 1.9.1, 1.10.0rc1, 1.10.0rc2, 1.10.0, 1.10.1rc1, 1.10.1rc2, 1.10.1, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.11.1rc1, 1.11.1, 1.12.0rc1, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0rc3, 1.13.0, 1.14.0rc1, 1.14.0rc2, 1.14.0, 1.14.1, 1.14.2rc1, 1.14.2, 1.15.0rc1, 1.15.0, 1.16.0rc1, 1.16.0, 1.16.1rc1, 1.16.1, 1.17.0rc1, 1.17.0, 1.17.1rc1, 1.17.1, 1.18.0rc1, 1.18.0, 1.19.0rc1, 1.19.0, 1.20.0rc1, 1.20.0rc2, 1.20.0rc3, 1.20.0, 1.20.1, 1.21.0rc1, 1.21.1rc1, 1.21.1, 1.22.0rc1, 1.22.0, 1.22.1, 1.23.0rc1, 1.23.0, 1.23.1, 1.24.0rc1, 1.24.0, 1.24.1, 1.24.3, 1.25.0rc1, 1.25.0, 1.26.0rc1, 1.26.0, 1.27.0rc1, 1.27.0rc2, 1.27.1, 1.27.2, 1.28.0.dev0, 1.28.0rc1, 1.28.0rc2, 1.28.0rc3, 1.28.1, 1.29.0, 1.30.0rc1, 1.30.0, 1.31.0rc1, 1.31.0rc2, 1.31.0, 1.32.0rc1, 1.32.0, 1.33.0rc1, 1.33.0rc2, 1.33.1, 1.33.2, 1.34.0rc1, 1.34.0, 1.34.1, 1.35.0rc1, 1.35.0, 1.36.0rc1, 1.36.0, 1.36.1, 1.37.0rc1, 1.37.0, 1.37.1, 1.38.0rc1, 1.38.0, 1.38.1, 1.39.0rc1, 1.39.0)
ERROR: No matching distribution found for grpcio<2,>=1.29.0

我使用 pip 21 和 python 3.8

有没有人已经遇到过类似的问题,并找到了解决方法?

谢谢

4

1 回答 1

0

解决了 !!我终于发现了问题所在。我没有指定我的 Dataflow docker worker 的图像标签。于是job开始寻找worker镜像版本,并开始安装一些依赖,就导致了这种错误。然后我不得不导出环境变量DATAFLOW_WORKER_DOCKER_IMAGE_TAG,一切都很好

于 2021-08-05T14:10:29.140 回答