Apache Beam-pip install'。[gcp,test]'-RuntimeError:不在apache git树中;无法找到原型定义

时间:2018-08-07 16:40:54

标签: python-2.7 sdk apache-beam

我正在尝试遵循Apache Beam贡献指南Developing with the Python SDK

使用Python 2.7.15 步骤:

  1. git clone git@github.com:apache / beam.git
  2. 创建一个新的虚拟环境(--no-side-packages)
  3. pip安装cython
  4. 在此sdks / python目录中运行pip install '.[gcp,test]'

输出:

pip install '.[gcp,test]' 
    Processing /Users/jcc/beam/sdks/python
    Complete output from command python setup.py egg_info:
    Compiling apache_beam/coders/stream.pyx because it changed.
    Compiling apache_beam/runners/worker/statesampler_fast.pyx because it changed.
    Compiling apache_beam/transforms/cy_dataflow_distribution_counter.pyx because it changed.
    Compiling apache_beam/coders/coder_impl.py because it changed.
    Compiling apache_beam/metrics/execution.py because it changed.
    Compiling apache_beam/runners/common.py because it changed.
    Compiling apache_beam/runners/worker/logger.py because it changed.
    Compiling apache_beam/runners/worker/opcounters.py because it changed.
    Compiling apache_beam/runners/worker/operations.py because it changed.
    Compiling apache_beam/transforms/cy_combiners.py because it changed.
    Compiling apache_beam/utils/counters.py because it changed.
    Compiling apache_beam/utils/windowed_value.py because it changed.
    [ 1/12] Cythonizing apache_beam/coders/coder_impl.py
    [ 2/12] Cythonizing apache_beam/coders/stream.pyx
    [ 3/12] Cythonizing apache_beam/metrics/execution.py
    [ 4/12] Cythonizing apache_beam/runners/common.py
    [ 5/12] Cythonizing apache_beam/runners/worker/logger.py
    [ 6/12] Cythonizing apache_beam/runners/worker/opcounters.py
    [ 7/12] Cythonizing apache_beam/runners/worker/operations.py
    [ 8/12] Cythonizing apache_beam/runners/worker/statesampler_fast.pyx
    [ 9/12] Cythonizing apache_beam/transforms/cy_combiners.py
    [10/12] Cythonizing apache_beam/transforms/cy_dataflow_distribution_counter.pyx
    [11/12] Cythonizing apache_beam/utils/counters.py
    [12/12] Cythonizing apache_beam/utils/windowed_value.py
    /Users/h4rry/env_beam/lib/python2.7/site-packages/setuptools/dist.py:398: UserWarning: Normalizing '2.7.0.dev' to '2.7.0.dev0'
    normalized_version,
    running egg_info
    /private/var/folders/k9/6y5rqvq91fv360rq0p271mkr0000gn/T/pip-req-build-YZpmvt/../common
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/k9/6y5rqvq91fv360rq0p271mkr0000gn/T/pip-req-build-YZpmvt/setup.py", line 218, in <module>
        'test': generate_protos_first(test),
    File "/Users/h4rry/env_beam/lib/python2.7/site-packages/setuptools/__init__.py", line 131, in setup
        return distutils.core.setup(**attrs)
    File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
    File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
    File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
    File "/private/var/folders/k9/6y5rqvq91fv360rq0p271mkr0000gn/T/pip-req-build-YZpmvt/setup.py", line 152, in run
        gen_protos.generate_proto_files()
    File "gen_protos.py", line 68, in generate_proto_files
        'Not in apache git tree; unable to find proto definitions.')
    RuntimeError: Not in apache git tree; unable to find proto definitions.

    ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/k9/6y5rqvq91fv360rq0p271mkr0000gn/T/pip-req-build-YZpmvt/

第68行中的文件“ gen_protos.py”:

if not os.path.exists(common):
        raise RuntimeError(
            'Not in apache git tree; unable to find proto definitions.') 

失败,因为该路径不存在:

当时

常见

/ private / var / folders / k9 / 6y5rqvq91fv360rq0p271mkr0000gn / T / pip-req-build-YZpmvt /../ common

我很新,我想念东西吗?

1 个答案:

答案 0 :(得分:0)

由于要从源代码安装Apache Beam,因此需要使用传入的-e标志进行安装,才能以“可编辑”模式进行安装。

pip install -e .[gcp,test]