python-2.7 - Apache Beam - pip install '.[gcp,test]' - RuntimeError: Not in apache git tree; 找不到原型定义
问题描述
我正在尝试遵循使用 Python SDK 开发的 Apache Beam 贡献指南
使用 Python 2.7.15 步骤:
- git clone git@github.com:apache/beam.git
- 创建一个新的虚拟环境 (--no-side-packages )
- 点安装cython
pip install '.[gcp,test]'
在这个 sdks/python 目录上运行
输出:
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
我对光束很陌生,我错过了什么吗?
解决方案
由于您是从源代码安装 Apache Beam,因此您需要使用-e
传入的标志进行安装,以便以“可编辑”模式安装。:
pip install -e .[gcp,test]
推荐阅读
- javascript - 如何将指定的值放入相应的位置
- javascript - JavaScript 可以编译成二进制文件吗?
- c# - LocalDb“管道末端没有进程”
- typescript - 在 Typescript 中,如何定义一个函数类型,允许在所需参数之前使用任意前面的参数?
- laravel - 使用 Laravel 通过邮件重置密码给 swiftmailer 错误代码 550(没有这样的用户)
- sql - 在 sql 查询中获取重复项
- rspec - Poltergeist:phantomjs_logger 选项被忽略
- spring-boot - Netflix Zuul注解导致spring boot app启动失败
- ios - 创建 NSAttributedString 时索引 1 超出范围 [0 .. 0]
- c# - 在服务列表中找不到 Windows 服务