I am trying to run my project which uses grpcio (which requires protobuf==5.26+). I can’t use it because streamlit requires protobuf < 5. Any reason why protobuf 5+ is not supported by the streamlit library?
- Are you sure that you actually use and need
grpcio
in your streamlit application? - Are you sure that you really need protobuf 5+ in your streamlit application?
If i am running pip install streamlit grpcio
in a clean python environment, i get no errors and the following versions are installed:
grpcio 1.64.0
protobuf 4.25.3
streamlit 1.35.0
If i am running pip install streamlit grpcio[protobuf]
in a clean python environment, i get no errors and the following versions are installed:
grpcio 1.62.2
grpcio-tools 1.62.2
protobuf 4.25.3
streamlit 1.35.0
Therefore i assume you either messed up your python environment or your requirements, or you unnecessarily enforced a protobuf version.
I assume because protobuf 5 is quite new and major revision changes are maybe not compatible and require some refactoring.
Well, I need my streamlit application to be the front end for a Retrieval Augmented Generation system using Weaviate and Ollama. Weaviate uses a grpcio
version which has a dependency protobuf==5.26+
. As the backend is more critical than the front end, I need to keep protobuf==5.27
.
Interestingly, even though I have installed protobuf==5.27
causing a dependency mismatch with streamlit, streamlit seems to be rendering my app just fine. Not sure which functionality this affects.
I still doubt that protobuf 5+ is really needed.
Please show me where this is enforced.
- Please don’t post logs as images
- This is not enough information to get the whole picture, can you please share the link to your public github repo?
- Don’t install pip packages manually one by one, this always leads to such conflicts
Hi,
I am facing the same issue:
- When installed grpcio-tools over existing strealit I received the following text:
pip install grpcio-tools
Collecting grpcio-tools
Downloading grpcio_tools-1.64.1-cp311-cp311-win_amd64.whl (1.1 MB)
Collecting protobuf<6.0dev,>=5.26.1
Downloading protobuf-5.27.0-cp310-abi3-win_amd64.whl (426 kB)
Collecting grpcio>=1.64.1
Downloading grpcio-1.64.1-cp311-cp311-win_amd64.whl (4.1 MB)
Requirement already satisfied: setuptools in [my env]
Installing collected packages: protobuf, grpcio, grpcio-tools
Attempting uninstall: protobuf
Found existing installation: protobuf 4.25.1
Uninstalling protobuf-4.25.1:
Successfully uninstalled protobuf-4.25.1
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
streamlit 1.29.0 requires protobuf<5,>=3.20, but you have protobuf 5.27.0 which is incompatible.
Successfully installed grpcio-1.64.1 grpcio-tools-1.64.1 protobuf-5.27.0
- Then I run upgrade for my streamlit installation and during this it downgraded the grpc-tools package:
pip install streamlit --upgrade
Collecting protobuf<5,>=3.20 (from streamlit)
Downloading protobuf-4.25.3-cp310-abi3-win_amd64.whl.metadata (541 bytes)
Installing collected packages: protobuf, streamlit
Attempting uninstall: protobuf
Found existing installation: protobuf 5.27.0
Uninstalling protobuf-5.27.0:
Successfully uninstalled protobuf-5.27.0
Attempting uninstall: streamlit
Found existing installation: streamlit 1.29.0
Uninstalling streamlit-1.29.0:
Successfully uninstalled streamlit-1.29.0
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
grpcio-tools 1.64.1 requires protobuf<6.0dev,>=5.26.1, but you have protobuf 4.25.3 which is incompatible.
Successfully installed protobuf-4.25.3 streamlit-1.35.0
- I upgraded grpc-tools package back and see the initial warning again:
pip install grpcio-tools --upgrade
Installing collected packages: protobuf
Attempting uninstall: protobuf
Found existing installation: protobuf 4.25.3
Uninstalling protobuf-4.25.3:
Successfully uninstalled protobuf-4.25.3
ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
streamlit 1.35.0 requires protobuf<5,>=3.20, but you have protobuf 5.27.0 which is incompatible.
Successfully installed protobuf-5.27.0
Once again:
- you certainly don’t need protobuf-5.27.0
- don’t install pip packages manually one by one
If i run pip install streamlit grpcio-tools
in a clean python env, i end up with these versions resolved by pip and everything should be fine:
grpcio 1.64.1
grpcio-tools 1.62.2
protobuf 4.25.3
streamlit 1.35.0