Hello,
I’m trying to deploy my project, but i get stuck by the version of one lib : protobuf
I tried everything i could to solve this issue (use other versions of tensorflow, protobuf, streamlit, …), but nothing works as protobuf is finally forced install to version 3.20.1 which is not compatible with tensorflow :
...
Streamlit 1.13.0 is present. Installing protobuf 3.20.1
Collecting protobuf==3.20.1
Downloading protobuf-3.20.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 28.9 MB/s eta 0:00:00[2023-04-28 08:39:10.971964]
Installing collected packages: protobuf
Attempting uninstall: protobuf
Found existing installation: protobuf 3.12.4
Uninstalling protobuf-3.12.4:
Successfully uninstalled protobuf-3.12.4
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.
tensorflow 2.11.0 requires protobuf<3.20,>=3.9.2, but you have protobuf 3.20.1 which is incompatible.
Successfully installed protobuf-3.20.1
Even if i ask for other versions of protobuf, this one gets installed… Is there a reason? Am I wrong somewhere?
As i already suspected the requirements.txt file is a total mess and the result of using pip freeze
Delete it and start from scratch…
Yes and only those you actually import in your application.
For the beginning you can also leave out the version numbers completely and let pip resolve it.
Unfortunately, streamlit cloud does force-install protobuf 3.20.1, as you suspected. I think if you pin that version in your requirements.txt, then tensorflow will end up with a version that is compatible with that version of protobuf.
I cloned your repo, added matplotlib to the dependencies, and it seems that all the dependencies install correctly. There are still some issues on the app related the way you are adding folders to PATH, but those are separate for the tensorflow dependency issues, I believe.
This is of course an important piece of information and boundary condition that i was previously unaware of and which is also not documented!?
That would mean, one would have to add now actually in each requirements.txt file always protobuf==3.20.1 to avoid such issues!?
And also, Tensorflow 2.9.0 would be the latest version you can use on streamlit cloud!?
Unfortunately, it is currently not documented, which is not good. There have been issues around incompatible-versions of protobuf before which necessitated this to ensure that 3rd-party dependencies don’t end up breaking streamlit for deployed apps. I’m working with our team to try and make sure either we figure out a different way of handling this issue, or adding something to the documentation to make note of this behavior of community cloud.