No, i am quite sure the issue comes with your (non-resolvable) pinned versions in your requirements file…
same behavior… the previous version is uninstalled and 3.20.1 is re-installed automatically
i built the req file from my local env (which works well) with “pip freeze”, so i shouldn’t get this version issue, no?
pip freeze is no guarantee and also bad practice.
Share your public github repo link and we can have a look.
ok, what should i do to build this file? only setting manually the libs i know i need?
My repo is here (folder stream_app) : GitHub - Montikore/OCRPyMan
As i already suspected the
requirements.txt file is a total mess and the result of using
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.
my req file is now only this:
numpy pandas opencv-python streamlit-drawable-canvas protobuf>=3.20.3 tensorflow
and i get same behavior : protobuf-3.20.1 is automatically installed and replace the previous one
Why on earth do you want to manipulate the protobuf version??? Keep your hands off…
This should work:
numpy pandas streamlit streamlit-drawable-canvas opencv-python-headless tensorflow
i tried first without protobuf
i just tried exactly what you gave, and still same behavior
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.
Now I understand why so many people are having issues with the Google APIs.
great! with this, the app is installing without errors, thanks!
but my app doesn’t get out of “the oven”
oh now it’s ok! it’s cooked and out of oven
i want to cry… i’m back with this now :
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
And the solution here does not work
Anyway, the initial issue seems to be solved, thanks!
how to use google api instead of requirements.txt
You don’t have to use google api, this is a misunderstanding.
Just fix your
Community Cloud has been updated so that protobuf is not pinned to this older version except for old versions of streamlit. So, if you’re using a relatively new version of streamlit, you will no longer see this pinning happen, and will be able to use libraries that depend on newer versions of protobuf (e.g. tensorflow).