【问题标题】:python: cannot import name beam_runner_api_pb2python:无法导入名称 beam_runner_api_pb2
【发布时间】:2018-04-30 20:41:25
【问题描述】:

我对 Python 和 Beam 比较陌生,并且我一直遵循 Apache Beam - Python 快速入门 (here) 的最后一个字母。我的 Python 2.7 虚拟环境是用 conda 创建的。

我从https://github.com/apache/beam克隆了示例

当我尝试运行时

python -m apache_beam.examples.wordcount --input sample_text.txt --output counts

我收到以下错误

/Users/name/anaconda3/envs/py27/bin/python: cannot import name beam_runner_api_pb2

(搜索后我理解为循环导入)

我不知道从哪里开始。这是错误还是我的设置有问题。

(我现在尝试在三个不同的虚拟环境中重做该示例 - 结果都相同)

【问题讨论】:

  • 我似乎没有正确安装 Google Cloud Platfrom (gcp) 组件,如下所示: # 作为初始设置的一部分,安装 Google Cloud Platform 特定的额外组件。 pip install apache-beam[gcp]

标签: python python-2.7 apache-beam


【解决方案1】:

看来是我的错。我没有正确安装 Google Cloud Platfrom (gcp) 组件。一旦我这样做了,一切都奏效了

# As part of the initial setup, install Google Cloud Platform specific extra components.
pip install apache-beam[gcp]

【讨论】:

    猜你喜欢
    • 2016-10-08
    • 2016-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多