question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import fails with `protobuf>3.20.x`

See original GitHub issue

Hi there,

Not sure if this is expected, but importing CARLA fails when protobuf>3.20.x is installed (see below). I’ve tried various default pyenv version (3.7.x) and they all shipped with protobuf>3.20.x, that’s how I came across this.

Many thanks!

TypeError                                 Traceback (most recent call last)
/var/folders/zn/yz12tx_128ggf8_ln3nn69p00000gn/T/ipykernel_93359/2127982349.py in <module>
      3 sys.path.append('..')
      4 
----> 5 from carla.recourse_methods import Dice, Wachter
      6 from copy import deepcopy
      7 # from model_shifts import (DynamicCsvCatalog,

~/.pyenv/versions/3.7.10/lib/python3.7/site-packages/carla/__init__.py in <module>
     16 from ._version import __version__
     17 from .data import Data, DataCatalog
---> 18 from .evaluation import Benchmark
     19 from .models import MLModel, MLModelCatalog
     20 from .recourse_methods import RecourseMethod

~/.pyenv/versions/3.7.10/lib/python3.7/site-packages/carla/evaluation/__init__.py in <module>
      1 # flake8: noqa
      2 
----> 3 from .benchmark import Benchmark
      4 from .distances import get_distances
      5 from .nearest_neighbours import yNN

~/.pyenv/versions/3.7.10/lib/python3.7/site-packages/carla/evaluation/benchmark.py in <module>
      6 
...
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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
kushan-gunasekeracommented, Jul 15, 2022

For anyone who is looking for a proper solution,

answer:- https://stackoverflow.com/a/72493690/6194097

1reaction
JohanvandenHeuvelcommented, Jul 5, 2022

Hey, yeah I don’t really know what is going on here, has to do with this and see this. So as far as I know this is not because of any issue on our end, but rather because we rely on other libraries which need to fix this.

Doing one of the workarounds should fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error using import in .proto file - Stack Overflow
Lets say, in Unix like environment, the path to the proto files is /home/path/to/the/protos/dir And the proto files have package and import ......
Read more >
Language Guide (proto3) | Protocol Buffers - Google Developers
Importing Definitions​​ You can use definitions from other . proto files by importing them. To import another . proto 's definitions, you add...
Read more >
Importing Protobuf with Go Modules - stepan.wtf
I started by thinking how would ideal solution look like and came up with a set of requirements: Correct versions - the imported...
Read more >
Use of import breaks generated code! - Google Groups
I'm converting a proto2 c interface to a proto3 c++ interface and have stumbled upon a problem related to import of proto files....
Read more >
protobuf · PyPI
protobuf 4.21.12. pip install protobuf. Copy PIP instructions. Latest version. Released: Dec 14, 2022.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found