ImportError: cannot import name ‘builder’ from ‘google.protobuf.internal’

Follow these steps:

  1. Install the latest protobuf version (in my case is 4.21.1)

pip install --upgrade protobuf

  1. Copy builder.py from .../Lib/site-packages/google/protobuf/internal to another folder on your computer (let’s say ‘Documents’)
  2. Install a protobuf version that is compatible with your project (for me 3.19.4)

pip install protobuf==3.19.4

  1. Copy builder.py from (let’s say ‘Documents’) to Lib/site-packages/google/protobuf/internal
  2. Run your code

Leave a Comment