prehistoric-afternoon-67621
08/01/2022, 2:05 PMfrom google.protobuf.internal import builder as _builder
E ImportError: cannot import name 'builder' from 'google.protobuf.internal'
I'm using protobuf==3.19.4
in the project. Unfortunately I have a requirement in the project that requires protobuf<3.20
(due to Tensorflow) so I can't bump this.
Anyone have any suggestions? 🙏prehistoric-afternoon-67621
08/01/2022, 2:11 PMprotoc
directly (version 3.19.4), I don't get the invalid import. So my guess is that pants 2.12 bumped the version of protoc that is used.sparse-lifeguard-95737
08/01/2022, 2:19 PMpants.toml
to fix it:
[protoc]
version = "3.9.2"
# NOTE: Since we're using a non-default version of protoc, we have to specify the sha256 and size
# of the download for each platform here.
#
# Downloads are coming from:
# <https://github.com/protocolbuffers/protobuf/releases/tag/v{version}-protoc-{version}-{platform}.zip>
#
# For each download we want to support,
# 1. Download it
# 2. Use `sha256sum` to compute the sha
# 3. Use `wc -c` to compute the size
# 4. Update the table here to match
known_versions = [
"3.9.2|linux_arm64 |55dba3d64d45fc79e4c93d376b2e578dfec913eaa2b6f071beb2460956a17db6|1443656",
"3.9.2|linux_x86_64|0d9034a3b02bd77edf5ef926fb514819a0007f84252c5e6a6391ddfc4189b904|1556020",
"3.9.2|macos_arm64 |f02de67311645bbc5a05d8dfc6f7ea6fe56f0db38546cb5327d1544a798a5612|2862486",
"3.9.2|macos_x86_64|f02de67311645bbc5a05d8dfc6f7ea6fe56f0db38546cb5327d1544a798a5612|2862486"
]
sparse-lifeguard-95737
08/01/2022, 2:20 PM[protoc.url_platform_mapping]
linux_arm64 = "linux-aarch_64"
linux_x86_64 = "linux-x86_64"
# NOTE: arm64-native protoc not available until v3.20.1, so we also download the x86_64
# binary when running on M1.
macos_arm64 = "osx-x86_64"
macos_x86_64 = "osx-x86_64"
prehistoric-afternoon-67621
08/01/2022, 2:20 PMprehistoric-afternoon-67621
08/01/2022, 2:31 PM