Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'runtime_version' from 'google.protobuf' #4437

Closed
Atry opened this issue Aug 23, 2024 · 0 comments · Fixed by #4438
Closed

ImportError: cannot import name 'runtime_version' from 'google.protobuf' #4437

Atry opened this issue Aug 23, 2024 · 0 comments · Fixed by #4438

Comments

@Atry
Copy link
Contributor

Atry commented Aug 23, 2024

When running Feast installed from git+https://github.com/feast-dev/feast, an ImportError is raised

Expected Behavior

No error

Current Behavior

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/nixos/feast-repository/.venv/lib/python3.11/site-packages/feast/__init__.py", line 4, in <module>
    from feast.infra.offline_stores.bigquery_source import BigQuerySource
  File "/home/nixos/feast-repository/.venv/lib/python3.11/site-packages/feast/infra/offline_stores/bigquery_source.py", line 5, in <module>
    from feast import type_map
  File "/home/nixos/feast-repository/.venv/lib/python3.11/site-packages/feast/type_map.py", line 39, in <module>
    from feast.protos.feast.types.Value_pb2 import (
  File "/home/nixos/feast-repository/.venv/lib/python3.11/site-packages/feast/protos/feast/types/Value_pb2.py", line 9, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (/home/nixos/feast-repository/.venv/lib/python3.11/site-packages/google/protobuf/__init__.py)

Steps to reproduce

pip install git+https://github.com/feast-dev/feast && python -m feast.protos.feast.types.Value_pb

Specifications

  • Version: master branch
  • Platform: Linux
  • Subsystem: Build System

Possible Solution

The problem is due to incompatible protobuf versions in build system dependencies and runtime dependencies. We should make the protobuf versions consistant.

cburroughs added a commit to cburroughs/feast that referenced this issue Aug 30, 2024
Right now if one downloads `feast-0.40.1-py2.py3-none-any.whl` from
PyPi it contains:
```
$ grep 'Protobuf Python Version' feast/protos/feast/registry/RegistryServer_pb2.py
```
Which is outside
```
$ grep 'protobuf<' feast-0.40.1.dist-info/METADATA
Requires-Dist: protobuf<5.0.0,>=4.24.0
```
Leading to runtime errors (feast-dev#4437).  This was mitigated by feast-dev#4438.  This
change tightens this up further by:
 * Deleting the Makefile command that was trying to do this
 unsuccessfully.
 * Aligns the setup/build requirements
 * Sets the version of protobuf to match the *minimum* of the range.
 There is no guarantee that protos generated by `4.X` will work with `4.(X-1)`.

Signed-off-by: Chris Burroughs <[email protected]>
cburroughs added a commit to cburroughs/feast that referenced this issue Aug 30, 2024
Right now if one downloads `feast-0.40.1-py2.py3-none-any.whl` from
PyPi it contains:
```
$ grep 'Protobuf Python Version' feast/protos/feast/registry/RegistryServer_pb2.py
```
Which is outside
```
$ grep 'protobuf<' feast-0.40.1.dist-info/METADATA
Requires-Dist: protobuf<5.0.0,>=4.24.0
```
Leading to runtime errors (feast-dev#4437).  This was mitigated by feast-dev#4438.  This
change tightens this up further by:
 * Deleting the Makefile command that was trying to do this
 unsuccessfully.
 * Aligns the setup/build requirements
 * Sets the version of protobuf to match the *minimum* of the range.
 There is no guarantee that protos generated by `4.X` will work with `4.(X-1)`.

Signed-off-by: Chris Burroughs <[email protected]>
tokoko pushed a commit that referenced this issue Sep 3, 2024
…4472)

build: explicit protobuf build version; consistent build/setup deps

Right now if one downloads `feast-0.40.1-py2.py3-none-any.whl` from
PyPi it contains:
```
$ grep 'Protobuf Python Version' feast/protos/feast/registry/RegistryServer_pb2.py
```
Which is outside
```
$ grep 'protobuf<' feast-0.40.1.dist-info/METADATA
Requires-Dist: protobuf<5.0.0,>=4.24.0
```
Leading to runtime errors (#4437).  This was mitigated by #4438.  This
change tightens this up further by:
 * Deleting the Makefile command that was trying to do this
 unsuccessfully.
 * Aligns the setup/build requirements
 * Sets the version of protobuf to match the *minimum* of the range.
 There is no guarantee that protos generated by `4.X` will work with `4.(X-1)`.

Signed-off-by: Chris Burroughs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant