Streamlit run with protobuf error

I encountered the same problem and avoided it by installing the compatible version of protobuf:


pip install 'protobuf~=3.19.0'

To deploy it on Streamlit Cloud, I added a line to requirements.txt:


For core dev team:

This is because the version of protobuf as a dependency of the streamlit package is specified as protobuf = ">=3.6.0, !=3.11", which allows installing major version-ups that may have breaking changes.

And it actually led to install a new version 4.21.0, which was released 5 hours ago with breaking changes, as described in the page linked from the error message:

The version specification in Pipfile should be something like protobuf = "~=3.19.0.
β†’ Set protobuf verion as ~=3.19.0 by whitphx Β· Pull Request #4779 Β· streamlit/streamlit Β· GitHub

5 Likes