Tensorflow and protobuf incompatibility

I could not get the tensorflow Variables to work because of protobuf incompatibility. Appreciate if someone can suggest how to fix it.

The following is the error:

$ python a.py
Traceback (most recent call last):
  File "a.py", line 20, in <module>
    a = tf.Variable(tf.zeros(2))
  File "/opt/miniconda3/lib/python3.8/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/opt/miniconda3/lib/python3.8/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 177, in _variable_handle_from_shape_and_dtype
    handle_data.shape_and_type.append(
AttributeError: 'google.protobuf.pyext._message.RepeatedCompositeCo' object has no attribute 'append'
(base) Auto-Surprise$

and the code is

import tensorflow as tf

a = tf.Variable(tf.zeros(2))
$ pip list | grep tensorflow
tensorflow                        2.7.0
tensorflow-estimator              2.7.0
$ pip list | grep protobuf
protobuf                                  4.21.1

Could you try using protobuf = 3.19.3 ?