Before clicking “Create Topic”, please make sure your post includes the following information (otherwise, the post will be locked).
Are you running your app locally or is it deployed?
If your app is deployed:
a. Is it deployed on Community Cloud or another hosting platform?
b. Share the link to the public deployed app.
Share the link to your app’s public GitHub repository (including a requirements file ).
Share the full text of the error message (not a screenshot).
Share the Streamlit and Python versions.
Need streamlit version for protobuf 3.19.
Hi @Sourav_Barua ,
What version of Streamlit are you using?
Goyo
November 6, 2023, 2:31pm
3
From the date of the change, looks like you need streamlit<1.23.0
.
streamlit:develop
← tconkling:tim/Protobuf4Support
opened 05:52PM - 03 May 23 UTC
- Bump our protobuf version range to `>= 3.20, < 5`
- python-protobuf >= 4.21 r… equires code generated from protoc (the protobuf compiler) >= 3.20, which means that we need to enforce protoc >= 3.20 as well
- This is enforced by `make check-protoc`, which runs when generating protobufs.
- Github Actions runs a version of Ubuntu that doesn't contain protoc 3.20 in its package repository, so we vendor a precompiled linux-x86_64 protoc binary for use by our Github Actions that require it.
Fixes https://github.com/streamlit/streamlit/issues/5626
latest version 1.28.with protobuf 3.19 streamlit showing error.
[{“metadata”:{“trusted”:true},“id”:“74abe0d1”,“cell_type”:“code”,“source”:“import streamlit as st”,“execution_count”:1,“outputs”:[{“output_type”:“error”,“ename”:“ImportError”,“evalue”:“cannot import name ‘builder’ from ‘google.protobuf.internal’ (C:\Users\user\AppData\Roaming\Python\Python310\site-packages\google\protobuf\internal\init .py)”,“traceback”:[“\u001b[1;31m---------------------------------------------------------------------------\u001b[0m”,“\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)”,“Cell \u001b[1;32mIn [1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mst\u001b[39;00m\n”,“File \u001b[1;32m~\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\init .py:56\u001b[0m\n\u001b[0;32m 53\u001b[0m \u001b[38;5;66;03m# Give the package a version.\u001b[39;00m\n\u001b[0;32m 54\u001b[0m version \u001b[38;5;241m=\u001b[39m _STREAMLIT_VERSION_STRING\n\u001b[1;32m—> 56\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdelta_generator\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m DeltaGenerator \u001b[38;5;28;01mas\u001b[39;00m _DeltaGenerator\n\u001b[0;32m 57\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproto\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mRootContainer_pb2\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m RootContainer \u001b[38;5;28;01mas\u001b[39;00m _RootContainer\n\u001b[0;32m 58\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mruntime\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcaching\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m (\n\u001b[0;32m 59\u001b[0m cache_resource \u001b[38;5;28;01mas\u001b[39;00m _cache_resource,\n\u001b[0;32m 60\u001b[0m cache_data \u001b[38;5;28;01mas\u001b[39;00m _cache_data,\n\u001b[0;32m 61\u001b[0m experimental_singleton \u001b[38;5;28;01mas\u001b[39;00m _experimental_singleton,\n\u001b[0;32m 62\u001b[0m experimental_memo \u001b[38;5;28;01mas\u001b[39;00m _experimental_memo,\n\u001b[0;32m 63\u001b[0m )\n”,“File \u001b[1;32m~\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\delta_generator.py:37\u001b[0m\n\u001b[0;32m 34\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mclick\u001b[39;00m\n\u001b[0;32m 35\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtyping_extensions\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Final, Literal\n\u001b[1;32m—> 37\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m config, cursor, env_util, logger, runtime, type_util, util\n\u001b[0;32m 38\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcursor\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Cursor\n\u001b[0;32m 39\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01melements\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01malert\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m AlertMixin\n”,“File \u001b[1;32m~\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\cursor.py:18\u001b[0m\n\u001b[0;32m 15\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtyping\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Any, List, Optional, Tuple\n\u001b[0;32m 17\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m util\n\u001b[1;32m—> 18\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mruntime\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mscriptrunner\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_script_run_ctx\n\u001b[0;32m 21\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mmake_delta_path\u001b[39m(\n\u001b[0;32m 22\u001b[0m root_container: \u001b[38;5;28mint\u001b[39m, parent_path: Tuple[\u001b[38;5;28mint\u001b[39m, \u001b[38;5;241m.\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;241m.\u001b[39m], index: \u001b[38;5;28mint\u001b[39m\n\u001b[0;32m 23\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m List[\u001b[38;5;28mint\u001b[39m]:\n\u001b[0;32m 24\u001b[0m delta_path \u001b[38;5;241m=\u001b[39m [root_container]\n”,“File \u001b[1;32m~\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\init .py:15\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)\u001b[39;00m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;66;03m#\u001b[39;00m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m# Licensed under the Apache License, Version 2.0 (the "License");\u001b[39;00m\n\u001b[1;32m (…)\u001b[0m\n\u001b[0;32m 12\u001b[0m \u001b[38;5;66;03m# See the License for the specific language governing permissions and\u001b[39;00m\n\u001b[0;32m 13\u001b[0m \u001b[38;5;66;03m# limitations under the License.\u001b[39;00m\n\u001b[1;32m—> 15\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mruntime\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mruntime\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Runtime, RuntimeConfig, RuntimeState\n\u001b[0;32m 16\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mruntime\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01msession_manager\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m (\n\u001b[0;32m 17\u001b[0m SessionClient,\n\u001b[0;32m 18\u001b[0m SessionClientDisconnectedError,\n\u001b[0;32m 19\u001b[0m )\n\u001b[0;32m 22\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mget_instance\u001b[39m() \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Runtime:\n”,“File \u001b[1;32m~\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\runtime.py:28\u001b[0m\n\u001b[0;32m 26\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m config\n\u001b[0;32m 27\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mlogger\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_logger\n\u001b[1;32m—> 28\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproto\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mBackMsg_pb2\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m BackMsg\n\u001b[0;32m 29\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mproto\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mForwardMsg_pb2\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m ForwardMsg\n\u001b[0;32m 30\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstreamlit\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mruntime\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mapp_session\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m AppSession\n”,“File \u001b[1;32m~\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\proto\BackMsg_pb2.py:5\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# -- coding: utf-8 - -\u001b[39;00m\n\u001b[0;32m 2\u001b[0m \u001b[38;5;66;03m# Generated by the protocol buffer compiler. DO NOT EDIT!\u001b[39;00m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;66;03m# source: streamlit/proto/BackMsg.proto\u001b[39;00m\n\u001b[0;32m 4\u001b[0m \u001b[38;5;124;03m"""Generated protocol buffer code."""\u001b[39;00m\n\u001b[1;32m----> 5\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mgoogle\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mprotobuf\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01minternal\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m builder \u001b[38;5;28;01mas\u001b[39;00m _builder\n\u001b[0;32m 6\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mgoogle\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mprotobuf\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m descriptor \u001b[38;5;28;01mas\u001b[39;00m _descriptor\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mgoogle\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mprotobuf\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m descriptor_pool \u001b[38;5;28;01mas\u001b[39;00m _descriptor_pool\n”,“\u001b[1;31mImportError\u001b[0m: cannot import name ‘builder’ from ‘google.protobuf.internal’ (C:\Users\user\AppData\Roaming\Python\Python310\site-packages\google\protobuf\internal\init .py)”]}]}]
Streamlit 1.28 requires protobuf >=3.20 and <5
By doing this i cant able to run sentence transform in streamlit. For that i need streamlit version for protobuf 3.19.
If you downgrade to Streamlit 1.22, you should be able to use protobuf 3.19.
Thank you so much. Its working fine now.
1 Like
Thank you.Its working fine now.
system
Closed
November 25, 2023, 6:49am
10
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.