Protobuf TypeError: Descriptors cannot not be created directly.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Reproduce the failure from agri_data/tests/imperviousness/test_views.py, then inspect vector_tile_base/vector_tile_pb2.py and the package's protobuf/protoc compatibility. Confirm the chosen compatibility path by rerunning the test and verifying that VectorTile imports without the descriptor TypeError.
Written by the indexing model from the issue text.
Description
agri_data/tests/imperviousness/test_views.py:5: in <module>
from vector_tile_base import VectorTile
/usr/local/lib/python3.9/site-packages/vector_tile_base/__init__.py:1: in <module>
from . import engine
/usr/local/lib/python3.9/site-packages/vector_tile_base/engine.py:3: in <module>
from . import vector_tile_pb2
/usr/local/lib/python3.9/site-packages/vector_tile_base/vector_tile_pb2.py:33: in <module>
_descriptor.EnumValueDescriptor(
/usr/local/lib/python3.9/site-packages/google/protobuf/descriptor.py:755: in __new__
_message.Message._CheckCalledFromGeneratedFile()
E TypeError: Descriptors cannot not be created directly.
E 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.
E If you cannot immediately regenerate your protos, some other possible workarounds are:
E 1. Downgrade the protobuf package to 3.20.x or lower.
E 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E
E More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
The protobuf changelog says the following:
We made some changes in Python language support in Protocol Buffers. Version 4.21.0 is a new major version, following 3.20.1. The new version is based on the upb library, and offers significantly better parsing performance than previous releases, especially for large payloads.
[...]
- Python upb requires generated code that has been generated from protoc 3.19.0 or newer.
- Dominant language
- Python
- Stars
- 57
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/vector-tile-base
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
mapbox/vector-tile-base#25 · 1 comment ·
-
`_points_equal` incorrectly compares floats with `is not`Possibly taken @SashaMIT claimed this 11 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 45/100
mapbox/vector-tile-base#19 · 1 comment ·
-
Make a PyPI packageOpen
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mapbox/vector-tile-base#18 · 1 comment · 9 reactions ·
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
mapbox/vector-tile-base#10 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
mapbox/vector-tile-base#9 · 1 comment ·
All issues in mapbox/vector-tile-base
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Graphify-Labs/graphify#4241 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
DeviceTrackerOpen
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
XiaoMi/ha_xiaomi_home#1821 ·
Maintainers usually reply within 1 day
-
Maven path-index: "Ambiguous or noncanonical artifact path" error does not report the offending pathOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pulp/pulp_maven#524 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day