googleapis / googleapis/python-aiplatform

Installing python-aiplatform && KFP on the same enviroment breaks KFP

未关闭
#2,921 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
api: vertex-ai
主要语言
Python
星标
905
派生
465
平均合并
1 天 13 小时
30 天内合并 PR
44

描述

#### Environment details

- OS type and version: Ubuntu 22.04
- Python version: 3.11.3
- pip version: 23.1.2
- `google-cloud-aiplatform` version: 1.36.0

#### Steps to reproduce

1. Create a new venv
2. `python -m pip install kfp==2.4.0
3. `python -m pip install google-cloud-aiplatform==1.36.0`

#### Code example

```python
import kfp
```

#### Stack trace
```
Traceback (most recent call last):
File "/home/davidnet/Documents/personal/aip_problem/main.py", line 1, in
import kfp
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/__init__.py", line 40, in
from kfp import components # noqa: keep unused import
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/components/__init__.py", line 27, in
from kfp.components.load_yaml_utilities import load_component_from_file
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/components/load_yaml_utilities.py", line 18, in
from kfp.dsl import structures
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/__init__.py", line 232, in
from kfp.dsl.component_decorator import component
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/component_decorator.py", line 19, in
from kfp.dsl import component_factory
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/component_factory.py", line 27, in
from kfp.dsl import container_component_class
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/container_component_class.py", line 18, in
from kfp.dsl import base_component
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/base_component.py", line 19, in
from kfp.dsl import pipeline_task
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/pipeline_task.py", line 26, in
from kfp.dsl import structures
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/dsl/structures.py", line 34, in
from kfp.pipeline_spec import pipeline_spec_pb2
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/kfp/pipeline_spec/pipeline_spec_pb2.py", line 38, in
_descriptor.EnumValueDescriptor(
File "/home/davidnet/Documents/personal/aip_problem/.venv/lib/python3.11/site-packages/google/protobuf/descriptor.py", line 780, in __new__
_message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
```

The only way to solve it is to set the enviroment variable, should this be also filled in kfp?

Thanks

贡献指南

打开贡献指南

调研方向

在全新的 Python 3.11 虚拟环境中,使用两个 pip 命令和所示的 `import kfp` 示例重现该故障。检查已安装的 protobuf 相关依赖约束,并确定该冲突是否属于此软件包;完成的标准是兼容性问题已解决,或所需的 workaround 已得到清晰记录并验证。

由索引模型根据 Issue 内容生成。

评估

技术栈
google-cloud, python
领域
machine-learning
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。