输入apache_beam.examples.wordcount [英] Input of apache_beam.examples.wordcount
问题描述
我试图运行Beam Python-SDK示例,但是在读取输入时遇到了问题.
I was trying to run the beam Python-SDK example, but I had problem in reading the input.
https://cwiki.apache.org/confluence/display/BEAM/Usage + Guide#UsageGuide-RunaPython-SDKPipeline
当我使用gs://dataflow-samples/shakespeare/kinglear.txt
作为输入时,错误是apache_beam.io.filesystem.BeamIOError: Match operation failed with exceptions {'gs://dataflow-samples/shakespeare/kinglear.txt': TypeError("__init__() got an unexpected keyword argument 'response_encoding'",)}
when I used gs://dataflow-samples/shakespeare/kinglear.txt
as the input, the error was apache_beam.io.filesystem.BeamIOError: Match operation failed with exceptions {'gs://dataflow-samples/shakespeare/kinglear.txt': TypeError("__init__() got an unexpected keyword argument 'response_encoding'",)}
当我使用本地文件时,似乎它实际上并未读取该文件,并且什么也不输出.结果不包含"has_job",我不确定它的实际含义是
when I used my local file, it seemed it didn't actually read the file, and output nothing. The result didn't include 'has_job', which I am not sure what it actually means https://github.com/apache/beam/blob/master/sdks/python/apache_beam/examples/wordcount.py#L118.
推荐答案
此错误是因为您的google-apitools版本太旧.您需要v0.5.23或更高版本才能避免此错误.
This error is because your version of google-apitools is too old. You need v0.5.23 or newer to avoid this error.
Beam python对依赖项具有严格版本要求.如果您正在运行Beam 2.11,则需要使用google-apitools v0.5.26.
Beam python has strict version requirements for dependencies. If you are running Beam 2.11, you need to be using google-apitools v0.5.26.
这篇关于输入apache_beam.examples.wordcount的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!